|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.mvstore.WriteBuffer
public class WriteBuffer
An auto-resize buffer to write data into a ByteBuffer.
Constructor Summary | |
---|---|
WriteBuffer()
|
Method Summary | |
---|---|
int |
capacity()
Get the capacity. |
WriteBuffer |
clear()
Clear the buffer after use. |
WriteBuffer |
get(byte[] dst)
Copy the data into the destination array. |
java.nio.ByteBuffer |
getBuffer()
Get the byte buffer. |
int |
limit()
Get the limit. |
WriteBuffer |
limit(int newLimit)
Set the limit, possibly growing the buffer. |
int |
position()
Get the current position. |
WriteBuffer |
position(int newPosition)
Set the position. |
WriteBuffer |
put(byte x)
Put a byte. |
WriteBuffer |
put(byte[] bytes)
Put a byte array. |
WriteBuffer |
put(byte[] bytes,
int offset,
int length)
Put a byte array. |
WriteBuffer |
put(java.nio.ByteBuffer src)
Put the contents of a byte buffer. |
WriteBuffer |
putChar(char x)
Put a character. |
WriteBuffer |
putDouble(double x)
Put a double. |
WriteBuffer |
putFloat(float x)
Put a float. |
WriteBuffer |
putInt(int x)
Put an integer. |
WriteBuffer |
putInt(int index,
int value)
Update an integer at the given index. |
WriteBuffer |
putLong(long x)
Put a long. |
WriteBuffer |
putShort(int index,
short value)
Update a short at the given index. |
WriteBuffer |
putShort(short x)
Put a short. |
WriteBuffer |
putStringData(java.lang.String s,
int len)
Write the characters of a string in a format similar to UTF-8. |
WriteBuffer |
putVarInt(int x)
Write a variable size integer. |
WriteBuffer |
putVarLong(long x)
Write a variable size long. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WriteBuffer()
Method Detail |
---|
public WriteBuffer putVarInt(int x)
x
- the value
public WriteBuffer putVarLong(long x)
x
- the value
public WriteBuffer putStringData(java.lang.String s, int len)
s
- the stringlen
- the number of characters to write
public WriteBuffer put(byte x)
x
- the value
public WriteBuffer putChar(char x)
x
- the value
public WriteBuffer putShort(short x)
x
- the value
public WriteBuffer putInt(int x)
x
- the value
public WriteBuffer putLong(long x)
x
- the value
public WriteBuffer putFloat(float x)
x
- the value
public WriteBuffer putDouble(double x)
x
- the value
public WriteBuffer put(byte[] bytes)
bytes
- the value
public WriteBuffer put(byte[] bytes, int offset, int length)
bytes
- the valueoffset
- the source offsetlength
- the number of bytes
public WriteBuffer put(java.nio.ByteBuffer src)
src
- the source buffer
public WriteBuffer limit(int newLimit)
newLimit
- the new limit
public int capacity()
public WriteBuffer position(int newPosition)
newPosition
- the new position
public int limit()
public int position()
public WriteBuffer get(byte[] dst)
dst
- the destination array
public WriteBuffer putInt(int index, int value)
index
- the indexvalue
- the value
public WriteBuffer putShort(int index, short value)
index
- the indexvalue
- the value
public WriteBuffer clear()
public java.nio.ByteBuffer getBuffer()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |