|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PacketEncoder
Interface specification for a packet encoder.
| Method Summary | |
|---|---|
OutputStream |
getStream()
Get the stream this encoder is writing to. |
PacketEncoder |
setStream(OutputStream out)
Set the output stream this encoder is writing to. |
PacketEncoder |
writeAddress(Address address)
Write an SMPP address to the output stream. |
PacketEncoder |
writeBytes(byte[] array)
|
PacketEncoder |
writeBytes(byte[] array,
int offset,
int length)
Write a byte array to the output stream. |
PacketEncoder |
writeCString(String value)
Write a C-String (one that is terminated with a nul byte) to the output stream. |
PacketEncoder |
writeDate(SMPPDate date)
Write an SMPP date to the output stream. |
PacketEncoder |
writeErrorAddress(ErrorAddress errorAddress)
Write an SMPP error address to the output stream. |
PacketEncoder |
writeInt4(int value)
Write a 4-byte integer to the output stream in big-endian order. |
PacketEncoder |
writeInt8(long value)
Write an 8-byte integer to the output stream in big-endian order. |
PacketEncoder |
writeString(String value,
int length)
Write a string to the output stream. |
PacketEncoder |
writeUInt1(int value)
Write a 1-byte unsigned integer to the output stream. |
PacketEncoder |
writeUInt2(int value)
Write a 2-byte unsigned integer to the output stream in big-endian order. |
PacketEncoder |
writeUInt4(long value)
Write a 4-byte unsigned integer to the output stream in big-endian order. |
| Method Detail |
|---|
PacketEncoder setStream(OutputStream out)
out - The output stream to write to.
OutputStream getStream()
PacketEncoder writeCString(String value)
throws IOException
value - The string value to write. If value is
null a single nul-byte will still be written.
IOException - If a problem occurs writing to the stream.
PacketEncoder writeString(String value,
int length)
throws IOException
value - The string value to write.length - The number of characters to write.
IOException - If a problem occurs writing to the stream.
IndexOutOfBoundsException - If length is
longer than the number of characters in value.
PacketEncoder writeUInt1(int value)
throws IOException
value - The integer value to send.
IOException - If a problem occurs writing to the stream.
PacketEncoder writeUInt2(int value)
throws IOException
value - The integer value to send.
IOException - If a problem occurs writing to the stream.
PacketEncoder writeUInt4(long value)
throws IOException
value - The integer value to send.
IOException - If a problem occurs writing to the stream.
PacketEncoder writeInt4(int value)
throws IOException
value - The integer value to send.
IOException - If a problem occurs writing to the stream.
PacketEncoder writeInt8(long value)
throws IOException
value - The integer value to send.
IOException - If a problem occurs writing to the stream.
PacketEncoder writeAddress(Address address)
throws IOException
address - The address to write to the stream.
IOException - If a problem occurs writing to the stream.
PacketEncoder writeErrorAddress(ErrorAddress errorAddress)
throws IOException
address - The error address to write.
IOException - If a problem occurs while writing.
PacketEncoder writeDate(SMPPDate date)
throws IOException
date - The SMPP date to write to the stream.
IOException - If a problem occurs writing to the stream.
PacketEncoder writeBytes(byte[] array)
throws IOException
IOException
PacketEncoder writeBytes(byte[] array,
int offset,
int length)
throws IOException
array - The byte array to write bytes from.offset - The offset to begin copying bytes from.length - The number of bytes to write.
IOException - If a problem occurs writing to the stream.
IndexOutOfBoundsException - if there are insufficient bytes
in the array to satisfy the length parameter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||