Package com.ibm.mq.headers
Interface MQData
- All Known Subinterfaces:
MQHeader
- All Known Implementing Classes:
com.ibm.mq.headers.internal.Header,MQCFBF,MQCFBF,MQCFBS,MQCFBS,MQCFGR,MQCFGR,MQCFH,MQCFH,MQCFIF,MQCFIF,MQCFIL,MQCFIL,MQCFIL64,MQCFIL64,MQCFIN,MQCFIN,MQCFIN64,MQCFIN64,MQCFSF,MQCFSF,MQCFSL,MQCFSL,MQCFST,MQCFST,MQCIH,MQDH,MQDLH,MQEPH,MQIIH,MQMD,MQMD1,MQMDE,MQRFH,MQRFH2,MQRMH,MQSAPH,MQTM,MQTM2,MQTMC2,MQWIH,MQXQH,PCFFilterParameter,PCFFilterParameter,PCFHeader,PCFHeader,PCFMessage,PCFMessage,PCFParameter,PCFParameter
public interface MQData
Interface representing a data element in an MQ message. This low-level interface represents
content that can be read and written, and occupies a known number of bytes in a message. The
MQHeader interface extends MQData and adds a representation of structured content with named
fields.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintReads content from a message.intReads content from a message or byte stream.intsize()intwrite(DataOutput message) Writes the content of this data element to a message.intwrite(DataOutput message, int encoding, int characterSet) Writes the content of this data element to a message or byte stream.
-
Method Details
-
read
Reads content from a message. The content is interpreted (if applicable) using the encoding and CCSID of the message descriptor.- Parameters:
message- the MQMessage to read from.- Returns:
- the number of bytes consumed.
- Throws:
MQDataException- if there is a problem reading the message contentIOException- if an error occurs reading message content.
-
read
int read(DataInput message, int encoding, int characterSet) throws Exception, MQDataException, IOException Reads content from a message or byte stream. The content is interpreted (if applicable) using the specified encoding and CCSID.- Parameters:
message- the message.encoding- the numeric encoding. see (CMQC.MQENC_* for values).characterSet- the Coded Character Set Identifier.- Returns:
- the number of bytes consumed.
- Throws:
Exception- (to allow the com.ibm.pcf classes to throw MQException)MQDataException- if there is a problem reading the message contentIOException- if an error occurs reading message content.
-
write
Writes the content of this data element to a message. The content is encoded in (if applicable) using the encoding and CCSID of the message descriptor.- Parameters:
message- the message.- Returns:
- the number of bytes written
- Throws:
IOException- if an error occurs writing message content.
-
write
Writes the content of this data element to a message or byte stream. The content is encoded (if applicable) using the specified encoding and CCSID.- Parameters:
message- the message.encoding- the numeric encoding. see (CMQC.MQENC_* for values)._characterSet- the Coded Character Set Identifier.- Returns:
- the number of bytes written
- Throws:
IOException- if an error occurs writing message content.
-
size
int size()- Returns:
- the size in bytes occupied by this data element in a message.
-