public final class LinkedBuffer extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
The default buffer size for a
LinkedBuffer. |
static int |
MIN_BUFFER_SIZE
The minimum buffer size for a
LinkedBuffer. |
| Modifier and Type | Method and Description |
|---|---|
static LinkedBuffer |
allocate()
Allocates a new buffer with default size.
|
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(DataOutput out,
LinkedBuffer node)
Writes the contents of the
LinkedBuffer into the DataOutput. |
static int |
writeTo(OutputStream out,
LinkedBuffer node)
Writes the contents of the
LinkedBuffer into the OutputStream. |
public static final int MIN_BUFFER_SIZE
LinkedBuffer.public static final int DEFAULT_BUFFER_SIZE
LinkedBuffer.public static LinkedBuffer allocate()
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(OutputStream out, LinkedBuffer node) throws IOException
LinkedBuffer into the OutputStream.IOExceptionpublic static int writeTo(DataOutput out, LinkedBuffer node) throws IOException
LinkedBuffer into the DataOutput.IOExceptionpublic LinkedBuffer clear()
Copyright © 2009–2020. All rights reserved.