public class SQSBytesMessage extends SQSMessage implements javax.jms.BytesMessage
ActiveMQStreamMessage, which is also
licensed under Apache2.0. Its methods are based largely on those found in
java.io.DataInputStream and
java.io.DataOutputStream.org.apache.activemq.command.ActiveMQStreamMessageSQSMessage.JMSMessagePropertyValue, SQSMessage.TypeConversionSupportBYTE_MESSAGE_TYPE, JMS_SQS_CORRELATION_ID, JMS_SQS_MESSAGE_TYPE, JMS_SQS_REPLY_TO_QUEUE_NAME, JMS_SQS_REPLY_TO_QUEUE_URL, OBJECT_MESSAGE_TYPE, TEXT_MESSAGE_TYPE| Constructor and Description |
|---|
SQSBytesMessage()
Create new empty BytesMessage to send.
|
SQSBytesMessage(Acknowledger acknowledger,
String queueUrl,
com.amazonaws.services.sqs.model.Message sqsMessage)
Convert received SQSMessage into BytesMessage.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearBody()
When the message is first created, and when clearBody is called, the body
of the message is in write-only mode.
|
byte[] |
getBodyAsBytes()
Reads the body of message, which can be either the body returned from the
the receives message as bytes or the bytes put in bytesOut if it is a
sent message.
|
long |
getBodyLength()
Gets the number of bytes of the message body when the message is in
read-only mode.
|
boolean |
readBoolean()
Reads a
boolean from the bytes message stream. |
byte |
readByte()
Reads a signed 8-bit value from the bytes message stream.
|
int |
readBytes(byte[] value)
Reads a byte array from the bytes message stream.
|
int |
readBytes(byte[] value,
int length)
Reads a portion of the bytes message stream.
|
char |
readChar()
Reads a Unicode character value from the bytes message stream.
|
double |
readDouble()
Reads a
double from the bytes message stream. |
float |
readFloat()
Reads a
float from the bytes message stream. |
int |
readInt()
Reads a 32-bit integer from the bytes message stream.
|
long |
readLong()
Reads a 64-bit integer from the bytes message stream.
|
short |
readShort()
Reads a signed 16-bit number from the bytes message stream.
|
int |
readUnsignedByte()
Reads an unsigned 8-bit value from the bytes message stream.
|
int |
readUnsignedShort()
Reads an unsigned 16-bit number from the bytes message stream.
|
String |
readUTF()
Reads a string that has been encoded using a UTF-8 format from
the bytes message stream
|
void |
reset()
Puts the message body in read-only mode and repositions the stream of
bytes to the beginning.
|
void |
writeBoolean(boolean value)
Writes a
boolean to the bytes message stream |
void |
writeByte(byte value)
Writes a
byte to the bytes message stream |
void |
writeBytes(byte[] value)
Writes a byte array to the bytes
message stream
|
void |
writeBytes(byte[] value,
int offset,
int length)
Writes a portion of a byte array to the bytes message stream.
|
void |
writeChar(char value)
Writes a
char to the bytes message stream |
void |
writeDouble(double value)
Writes a
double to the bytes message stream |
void |
writeFloat(float value)
Writes a
float to the bytes message stream |
void |
writeInt(int value)
Writes a
int to the bytes message stream |
void |
writeLong(long value)
Writes a
long to the bytes message stream |
void |
writeObject(Object value)
Writes an object to the bytes message stream.
|
void |
writeShort(short value)
Writes a
short to the bytes message stream |
void |
writeUTF(String value)
Writes a string that has been encoded using a UTF-8 format to the bytes
message stream
|
acknowledge, checkBodyWritePermissions, checkPropertyWritePermissions, clearProperties, convertExceptionToJMSException, convertExceptionToMessageFormatException, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSMessagePropertyValue, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getQueueUrl, getReceiptHandle, getShortProperty, getSQSMessageDeduplicationId, getSQSMessageGroupId, getSQSMessageId, getSQSMessageSequenceNumber, getStringProperty, propertyExists, setBodyWritePermissions, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setSequenceNumber, setShortProperty, setSQSMessageId, setStringPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitacknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringPropertypublic SQSBytesMessage(Acknowledger acknowledger, String queueUrl, com.amazonaws.services.sqs.model.Message sqsMessage) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic SQSBytesMessage()
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic long getBodyLength()
throws javax.jms.JMSException
getBodyLength in interface javax.jms.BytesMessagejavax.jms.MessageNotReadableException - If the message is in write-only mode.javax.jms.JMSExceptionpublic boolean readBoolean()
throws javax.jms.JMSException
boolean from the bytes message stream.readBoolean in interface javax.jms.BytesMessageboolean valuejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public byte readByte()
throws javax.jms.JMSException
readByte in interface javax.jms.BytesMessagejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public int readUnsignedByte()
throws javax.jms.JMSException
readUnsignedByte in interface javax.jms.BytesMessagejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public short readShort()
throws javax.jms.JMSException
readShort in interface javax.jms.BytesMessagejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public int readUnsignedShort()
throws javax.jms.JMSException
readUnsignedShort in interface javax.jms.BytesMessagejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public char readChar()
throws javax.jms.JMSException
readChar in interface javax.jms.BytesMessagejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public int readInt()
throws javax.jms.JMSException
readInt in interface javax.jms.BytesMessagejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public long readLong()
throws javax.jms.JMSException
readLong in interface javax.jms.BytesMessagejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public float readFloat()
throws javax.jms.JMSException
float from the bytes message stream.readFloat in interface javax.jms.BytesMessagefloat value from the bytes message streamjavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public double readDouble()
throws javax.jms.JMSException
double from the bytes message stream.readDouble in interface javax.jms.BytesMessagedouble value from the bytes message streamjavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public String readUTF() throws javax.jms.JMSException
readUTF in interface javax.jms.BytesMessagejavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageEOFException - If unexpected end of bytes stream has been reached.javax.jms.MessageNotReadableException - If the message is in write-only mode.public int readBytes(byte[] value)
throws javax.jms.JMSException
If the length of array value is less than the number of bytes remaining to be read from the stream, the array should be filled. A subsequent call reads the next increment, and so on.
If the number of bytes remaining in the stream is less than the length of array value, the bytes should be read into the array. The return value of the total number of bytes read will be less than the length of the array, indicating that there are no more bytes left to be read from the stream. The next read of the stream returns -1.
readBytes in interface javax.jms.BytesMessagevalue - The buffer into which the data is readjavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageNotReadableException - If the message is in write-only mode.public int readBytes(byte[] value,
int length)
throws javax.jms.JMSException
If the length of array value is less than the number of bytes remaining to be read from the stream, the array should be filled. A subsequent call reads the next increment, and so on.
If the number of bytes remaining in the stream is less than the length of array value, the bytes should be read into the array. The return value of the total number of bytes read will be less than the length of the array, indicating that there are no more bytes left to be read from the stream. The next read of the stream returns -1.
If length is negative, then an IndexOutOfBoundsException is
thrown. No bytes will be read from the stream for this exception case.
readBytes in interface javax.jms.BytesMessagevalue - The buffer into which the data is readlength - The number of bytes to read; must be less than or equal to
value.lengthjavax.jms.JMSException - If the JMS provider fails to read the message due to some
internal error.javax.jms.MessageNotReadableException - If the message is in write-only mode.public void writeBoolean(boolean value)
throws javax.jms.JMSException
boolean to the bytes message streamwriteBoolean in interface javax.jms.BytesMessagevalue - The boolean value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeByte(byte value)
throws javax.jms.JMSException
byte to the bytes message streamwriteByte in interface javax.jms.BytesMessagevalue - The byte value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeShort(short value)
throws javax.jms.JMSException
short to the bytes message streamwriteShort in interface javax.jms.BytesMessagevalue - The short value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeChar(char value)
throws javax.jms.JMSException
char to the bytes message streamwriteChar in interface javax.jms.BytesMessagevalue - The char value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeInt(int value)
throws javax.jms.JMSException
int to the bytes message streamwriteInt in interface javax.jms.BytesMessagevalue - The int value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeLong(long value)
throws javax.jms.JMSException
long to the bytes message streamwriteLong in interface javax.jms.BytesMessagevalue - The long value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeFloat(float value)
throws javax.jms.JMSException
float to the bytes message streamwriteFloat in interface javax.jms.BytesMessagevalue - The float value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeDouble(double value)
throws javax.jms.JMSException
double to the bytes message streamwriteDouble in interface javax.jms.BytesMessagevalue - The double value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeUTF(String value) throws javax.jms.JMSException
writeUTF in interface javax.jms.BytesMessagevalue - The String value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeBytes(byte[] value)
throws javax.jms.JMSException
writeBytes in interface javax.jms.BytesMessagevalue - The byte array value to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeBytes(byte[] value,
int offset,
int length)
throws javax.jms.JMSException
writeBytes in interface javax.jms.BytesMessagevalue - The portion of byte array value to be writtenoffset - The initial offset within the byte arraylength - The number of bytes to usejavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.public void writeObject(Object value) throws javax.jms.JMSException
This method works only for the boxed primitive object types (Integer, Double, Long ...), String objects, and byte arrays.
writeObject in interface javax.jms.BytesMessagevalue - The Java object to be writtenjavax.jms.JMSException - If the JMS provider fails to write the message due to some
internal error.javax.jms.MessageNotWriteableException - If the message is in read-only mode.javax.jms.MessageFormatException - If the object is of an invalid type.NullPointerException - If the object is null.public void reset()
throws javax.jms.JMSException
reset in interface javax.jms.BytesMessagejavax.jms.JMSExceptionpublic void clearBody()
throws javax.jms.JMSException
clearBody in interface javax.jms.MessageclearBody in class SQSMessagejavax.jms.JMSException - If directly calledpublic byte[] getBodyAsBytes()
throws javax.jms.JMSException
javax.jms.JMSExceptionCopyright © 2022. All rights reserved.