public abstract class BytesInput extends Object
| Constructor and Description |
|---|
BytesInput() |
| Modifier and Type | Method and Description |
|---|---|
static BytesInput |
concat(BytesInput... inputs)
logically concatenate the provided inputs
|
static BytesInput |
concat(List<BytesInput> inputs)
logically concatenate the provided inputs
|
static BytesInput |
copy(BytesInput bytesInput)
copies the input into a new byte array
|
static BytesInput |
empty() |
static BytesInput |
from(byte[] in) |
static BytesInput |
from(byte[] in,
int offset,
int length) |
static BytesInput |
from(ByteArrayOutputStream baos) |
static BytesInput |
from(ByteBuffer... buffers) |
static BytesInput |
from(ByteBuffer buffer,
int offset,
int length)
Deprecated.
Will be removed in 2.0.0
|
static BytesInput |
from(CapacityByteArrayOutputStream arrayOut) |
static BytesInput |
from(InputStream in,
int bytes) |
static BytesInput |
from(List<ByteBuffer> buffers) |
static BytesInput |
fromInt(int intValue) |
static BytesInput |
fromUnsignedVarInt(int intValue) |
static BytesInput |
fromUnsignedVarLong(long longValue) |
static BytesInput |
fromZigZagVarInt(int intValue) |
static BytesInput |
fromZigZagVarLong(long longValue) |
abstract long |
size() |
byte[] |
toByteArray() |
ByteBuffer |
toByteBuffer() |
ByteBufferInputStream |
toInputStream() |
abstract void |
writeAllTo(OutputStream out)
writes the bytes into a stream
|
public static BytesInput concat(BytesInput... inputs)
inputs - the inputs to concatenatepublic static BytesInput concat(List<BytesInput> inputs)
inputs - the inputs to concatenatepublic static BytesInput from(InputStream in, int bytes)
in - an input streambytes - number of bytes to read@Deprecated public static BytesInput from(ByteBuffer buffer, int offset, int length)
buffer - length - number of bytes to readpublic static BytesInput from(ByteBuffer... buffers)
buffers - an array of byte bufferspublic static BytesInput from(List<ByteBuffer> buffers)
buffers - a list of byte bufferspublic static BytesInput from(byte[] in)
in - a byte arraypublic static BytesInput from(byte[] in, int offset, int length)
public static BytesInput fromInt(int intValue)
intValue - the int to writepublic static BytesInput fromUnsignedVarInt(int intValue)
intValue - the int to writepublic static BytesInput fromZigZagVarInt(int intValue)
intValue - the int to writepublic static BytesInput fromUnsignedVarLong(long longValue)
longValue - the long to writepublic static BytesInput fromZigZagVarLong(long longValue)
longValue - the long to writepublic static BytesInput from(CapacityByteArrayOutputStream arrayOut)
arrayOut - a capacity byte array output stream to wrap into a BytesInputpublic static BytesInput from(ByteArrayOutputStream baos)
baos - - stream to wrap into a BytesInputpublic static BytesInput empty()
public static BytesInput copy(BytesInput bytesInput) throws IOException
bytesInput - a BytesInputIOException - if there is an exception when reading bytes from the BytesInputpublic abstract void writeAllTo(OutputStream out) throws IOException
out - an output streamIOException - if there is an exception writingpublic byte[] toByteArray()
throws IOException
IOException - if there is an exception readingpublic ByteBuffer toByteBuffer() throws IOException
IOException - if there is an exception readingpublic ByteBufferInputStream toInputStream() throws IOException
IOException - if there is an exception readingpublic abstract long size()
Copyright © 2018 The Apache Software Foundation. All rights reserved.