ByteBuffers to OutputStreams.
| Modifier and Type | Field and Description |
|---|---|
| private static final ThreadLocal | BUFFER
Keeping a soft reference to a thread-local buffer. |
| private static final float | BUFFER_REALLOCATION_THRESHOLD
The fraction of the requested buffer size under which the buffer will be reallocated. |
| private static final long | |
| private static final Class | FILE_OUTPUT_STREAM_CLASS
This is a hack for GAE, where |
| private static final int | MAX_CACHED_BUFFER_SIZE
Maximum size for a cached buffer. |
| private static final int | MIN_CACHED_BUFFER_SIZE
Minimum size for a cached buffer. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | |
| private static byte[] | |
| private static long | |
| private static byte[] | |
| private static boolean | |
| private static Class | |
| private static void | |
| pack-priv static void | write(ByteBuffer buffer, OutputStream output)
Writes the remaining content of the buffer to the given stream. |
| private static boolean |
| BUFFER | back to summary |
|---|---|
| private static final ThreadLocal<SoftReference<byte[]>> BUFFER Keeping a soft reference to a thread-local buffer. This buffer is used for writing a | |
| BUFFER_REALLOCATION_THRESHOLD | back to summary |
|---|---|
| private static final float BUFFER_REALLOCATION_THRESHOLD The fraction of the requested buffer size under which the buffer will be reallocated. | |
| CHANNEL_FIELD_OFFSET | back to summary |
|---|---|
| private static final long CHANNEL_FIELD_OFFSET | |
| FILE_OUTPUT_STREAM_CLASS | back to summary |
|---|---|
| private static final Class<?> FILE_OUTPUT_STREAM_CLASS This is a hack for GAE, where | |
| MAX_CACHED_BUFFER_SIZE | back to summary |
|---|---|
| private static final int MAX_CACHED_BUFFER_SIZE Maximum size for a cached buffer. If a larger buffer is required, it will be allocated but not cached. | |
| MIN_CACHED_BUFFER_SIZE | back to summary |
|---|---|
| private static final int MIN_CACHED_BUFFER_SIZE Minimum size for a cached buffer. This prevents us from allocating buffers that are too small to be easily reused. | |
| ByteBufferWriter | back to summary |
|---|---|
| private ByteBufferWriter() | |
| clearCachedBuffer | back to summary |
|---|---|
| pack-priv static void clearCachedBuffer() For testing purposes only. Clears the cached buffer to force a new allocation on the next invocation. | |
| getBuffer | back to summary |
|---|---|
| private static byte[] getBuffer() | |
| getChannelFieldOffset | back to summary |
|---|---|
| private static long getChannelFieldOffset(Class<?> clazz) | |
| getOrCreateBuffer | back to summary |
|---|---|
| private static byte[] getOrCreateBuffer(int requestedSize) | |
| needToReallocate | back to summary |
|---|---|
| private static boolean needToReallocate(int requestedSize, int bufferLength) | |
| safeGetClass | back to summary |
|---|---|
| private static Class | |
| setBuffer | back to summary |
|---|---|
| private static void setBuffer(byte[] value) | |
| write | back to summary |
|---|---|
| pack-priv static void write(ByteBuffer buffer, OutputStream output) throws IOException Writes the remaining content of the buffer to the given stream. The buffer | |
| writeToChannel | back to summary |
|---|---|
| private static boolean writeToChannel(ByteBuffer buffer, OutputStream output) throws IOException | |