|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fusesource.hawtbuf.BufferEditor
public abstract class BufferEditor
Used to write and read primitives to and from a Buffer. Reads and writes are done at the buffers offset. Every read and write increases the buffer's offset and decreases the buffer's length.
Bounds checking are only performed when assertions are enabled on the JVM. It's up to you to make sure there is enough data/space in the buffer to do the read or write.
Field Summary | |
---|---|
protected Buffer |
buffer
|
Method Summary | |
---|---|
protected boolean |
hasCapacity(int len)
|
int |
read()
|
boolean |
readBoolean()
|
byte |
readByte()
|
abstract char |
readChar()
|
abstract double |
readDouble()
|
abstract float |
readFloat()
|
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
abstract int |
readInt()
|
abstract long |
readLong()
|
abstract short |
readShort()
|
int |
readUnsignedByte()
|
abstract int |
readUnsignedShort()
|
int |
readVarInt()
Read a raw Varint from the stream. |
long |
readVarLong()
Read a raw Varint from the stream. |
int |
readVarSignedInt()
Read an sint32 field value from the stream. |
long |
readVarSignedLong()
Read an sint64 field value from the stream. |
int |
skipBytes(int n)
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
void |
writeBoolean(boolean v)
|
void |
writeByte(int v)
|
abstract void |
writeChar(int v)
|
abstract void |
writeDouble(double v)
|
abstract void |
writeFloat(float v)
|
abstract void |
writeInt(int v)
|
abstract void |
writeLong(long v)
|
abstract void |
writeRawDouble(double v)
|
abstract void |
writeRawFloat(float v)
|
abstract void |
writeShort(int v)
|
void |
writeVarInt(int value)
Encode and write a varint. |
void |
writeVarLong(long value)
Encode and write a varint. |
void |
writeVarSignedInt(int value)
|
void |
writeVarSignedLong(long value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Buffer buffer
Method Detail |
---|
protected boolean hasCapacity(int len)
public int read()
public void readFully(byte[] b)
public void readFully(byte[] b, int off, int len)
public int skipBytes(int n)
public boolean readBoolean()
public byte readByte()
public int readUnsignedByte()
public void write(int b)
public void write(byte[] b)
public void write(byte[] b, int off, int len)
public void writeBoolean(boolean v)
public void writeByte(int v)
public int readVarInt() throws java.io.IOException
java.io.IOException
public long readVarLong() throws java.io.IOException
java.io.IOException
public int readVarSignedInt() throws java.io.IOException
sint32
field value from the stream.
java.io.IOException
public long readVarSignedLong() throws java.io.IOException
sint64
field value from the stream.
java.io.IOException
public void writeVarInt(int value) throws java.io.IOException
value
is treated as unsigned, so it
won't be sign-extended if negative.
java.io.IOException
public void writeVarLong(long value) throws java.io.IOException
java.io.IOException
public void writeVarSignedInt(int value) throws java.io.IOException
java.io.IOException
public void writeVarSignedLong(long value) throws java.io.IOException
java.io.IOException
public abstract short readShort()
public abstract int readUnsignedShort()
public abstract char readChar()
public abstract int readInt()
public abstract long readLong()
public abstract double readDouble()
public abstract float readFloat()
public abstract void writeShort(int v)
public abstract void writeChar(int v)
public abstract void writeInt(int v)
public abstract void writeLong(long v)
public abstract void writeDouble(double v)
public abstract void writeFloat(float v)
public abstract void writeRawDouble(double v)
public abstract void writeRawFloat(float v)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |