Adds as many zero padding bytes as necessary to stop on a 4 byte alignment.
Adds as many zero padding bytes as necessary to stop on a 4 byte alignment. if the buffer position is already on a 4 byte alignment when calling this function, this method does nothing.
the buffer to align
BufferOverflowException
in case the padding exceeds
the provided buffer limit
Prints a hex-dump version of a packet to a given stream.
Prints a hex-dump version of a packet to a given stream.
The format is similar to scsynth using dump mode 2.
Unlike printTextOn
this takes a raw received
or encoded byte buffer and not a decoded instance
of Packet
.
the byte buffer containing the packet. the current position is saved, and the printing is performed from position 0 to the limit of the buffer. the previous position is restored.
the print stream to use, for example System.out
java.nio.Buffer#position()
java.nio.Buffer#limit()
Prints a text version of a packet to a given stream.
Prints a text version of a packet to a given stream. The format is similar to scsynth using dump mode 1. Bundles will be printed with each message on a separate line and increasing indent.
the packet to print (either a message or bundle)
the print stream to use, for example System.out
Reads a null terminated string from the current buffer position
Reads a null terminated string from the current buffer position
buffer to read from. position and limit must be set appropriately. new position will be right after the terminating zero byte when the method returns
BufferUnderflowException
in case the string exceeds
the provided buffer limit
Advances the current buffer position to an integer of four bytes.
Advances the current buffer position to an integer of four bytes. The position is not altered if it is already aligned to a four byte boundary.
the buffer to advance
BufferUnderflowException
in case the skipping exceeds
the provided buffer limit
Advances in the buffer as long there are non-zero bytes, then advance to a four byte alignment.
Advances in the buffer as long there are non-zero bytes, then advance to a four byte alignment.
the buffer to advance
BufferUnderflowException
in case the reads exceed
the provided buffer limit
Adds as many zero padding bytes as necessary to stop on a 4 byte alignment.
Adds as many zero padding bytes as necessary to stop on a 4 byte alignment. if the buffer position is already on a 4 byte alignment when calling this function, another 4 zero padding bytes are added. buffer position will be on the new aligned boundary when return from this method
the buffer to pad
BufferOverflowException
in case the padding exceeds
the provided buffer limit