|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dyuproject.protostuff.LinkedBuffer
public final class LinkedBuffer
A buffer that wraps a byte array and has a reference to the next buffer for dynamic increase.
| Field Summary | |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
The default buffer size for a LinkedBuffer. |
static int |
MIN_BUFFER_SIZE
The minimum buffer size for a LinkedBuffer. |
| Method Summary | |
|---|---|
static LinkedBuffer |
allocate(int size)
Allocates a new buffer with the specified size. |
static LinkedBuffer |
allocate(int size,
LinkedBuffer previous)
Allocates a new buffer with the specified size and appends it to the previous buffer. |
LinkedBuffer |
clear()
The offset will be reset to its starting position. |
static LinkedBuffer |
use(byte[] buffer)
Uses the existing byte array as the internal buffer. |
static LinkedBuffer |
use(byte[] buffer,
int start)
Uses the existing byte array as the internal buffer. |
static LinkedBuffer |
wrap(byte[] array,
int offset,
int length)
Wraps the byte array buffer as a read-only buffer. |
static int |
writeTo(java.io.DataOutput out,
LinkedBuffer node)
Writes the contents of the LinkedBuffer into the DataOutput. |
static int |
writeTo(java.io.OutputStream out,
LinkedBuffer node)
Writes the contents of the LinkedBuffer into the OutputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MIN_BUFFER_SIZE
LinkedBuffer.
public static final int DEFAULT_BUFFER_SIZE
LinkedBuffer.
| Method Detail |
|---|
public static LinkedBuffer allocate(int size)
public static LinkedBuffer allocate(int size,
LinkedBuffer previous)
public static LinkedBuffer wrap(byte[] array,
int offset,
int length)
public static LinkedBuffer use(byte[] buffer)
public static LinkedBuffer use(byte[] buffer,
int start)
public static int writeTo(java.io.OutputStream out,
LinkedBuffer node)
throws java.io.IOException
LinkedBuffer into the OutputStream.
java.io.IOException
public static int writeTo(java.io.DataOutput out,
LinkedBuffer node)
throws java.io.IOException
LinkedBuffer into the DataOutput.
java.io.IOExceptionpublic LinkedBuffer clear()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||