|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.otfeed.support.BufferFormat
public class BufferFormat
Converts ByteBuffer type to/from a string.
Formats buffer into multi-line string, each line showing up to 16 bytes of the data in a standard "hexdump" format. For example,00000001 40360000 00000000 21000001 %....@6......!... 148a6fe0 69 %..o.iWhen parsing, ignores empty lines, and treat separator symbol as start of comment. Therefore, following is a valid input to the parse method:
% % buffer snippet % 00000001 40360000 00000000 21000001 %....@6......!... 148a6fe0 69 %..o.i
Constructor Summary | |
---|---|
BufferFormat()
Creates format using the default byte-reversed allocation service . |
|
BufferFormat(IBufferAllocator allocator)
Creates format using the provided allocator service (used for parsing only. |
Method Summary | |
---|---|
java.lang.String |
format(java.nio.ByteBuffer buffer)
Formats an object to a string. |
char |
getSeparator()
Symbol that marks the beginnig of comment. |
java.nio.ByteBuffer |
parse(java.lang.String val)
Parses object from a string. |
void |
setSeparator(char val)
Sets separator character. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BufferFormat(IBufferAllocator allocator)
parsing
only.
allocator
- allocator.public BufferFormat()
byte-reversed allocation service
.
Method Detail |
---|
public char getSeparator()
public void setSeparator(char val)
val
- separator character.public java.lang.String format(java.nio.ByteBuffer buffer)
IFormat
format
in interface IFormat<java.nio.ByteBuffer>
buffer
- object to be formatted.
public java.nio.ByteBuffer parse(java.lang.String val)
IFormat
parse
in interface IFormat<java.nio.ByteBuffer>
val
- string representation of an object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |