public final class ByteString extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
byte |
byteAt(int index)
Get the byte on the input index.
|
static ByteString |
from(byte[] bytes)
Static factory method creating a ByteString object.
|
static ByteString |
from(ByteArrayOutputStream byteArrayOutputStream)
Factory method that creates a ByteString object from byteArrayOutputStream object.
|
boolean |
isEmpty()
Is the byte array empty?
|
int |
size()
Get the number of bytes in this byte array.
|
byte[] |
toByteArray()
Get the copy of the byte array.
|
InputStream |
toInputStream()
Get the byte array input stream off the byte array stored.
|
void |
write(OutputStream outputStream)
Writes the bytes to the output stream.
|
public static ByteString from(byte[] bytes)
bytes
- byte arraypublic byte byteAt(int index)
index
- index no of the byte to be returned.public boolean isEmpty()
public int size()
public byte[] toByteArray()
public void write(OutputStream outputStream) throws IOException
outputStream
- that will be used to write the bytes.IOException
public static ByteString from(ByteArrayOutputStream byteArrayOutputStream)
byteArrayOutputStream
- that will be used to extract the arrays for creating the ByteString object.public InputStream toInputStream()
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries