public final class BytesOf extends Object implements Bytes
There is no thread-safety guarantee.
Bytes.NoNulls
Constructor and Description |
---|
BytesOf(byte... bytes)
Ctor.
|
BytesOf(char... chars)
Ctor.
|
BytesOf(char[] chars,
Charset cset)
Ctor.
|
BytesOf(CharSequence builder)
Ctor.
|
BytesOf(CharSequence builder,
Charset cset)
Ctor.
|
BytesOf(File file)
Ctor.
|
BytesOf(Input input)
Ctor.
|
BytesOf(Input input,
int max)
Ctor.
|
BytesOf(Path path)
Ctor.
|
BytesOf(Reader rdr)
Ctor.
|
BytesOf(Reader rdr,
Charset cset)
Ctor.
|
BytesOf(Reader rdr,
Charset cset,
int max)
Ctor.
|
BytesOf(String source)
Ctor.
|
BytesOf(String source,
Charset cset)
Ctor.
|
BytesOf(Text text)
Ctor.
|
BytesOf(Text text,
Charset cset)
Ctor.
|
BytesOf(Throwable error)
Ctor.
|
public BytesOf(Input input)
input
- The inputpublic BytesOf(File file)
file
- The inputpublic BytesOf(Path path)
path
- The inputpublic BytesOf(Input input, int max)
input
- The inputmax
- Max length of the buffer for readingpublic BytesOf(Reader rdr)
rdr
- Readerpublic BytesOf(Reader rdr, Charset cset, int max)
rdr
- Readercset
- Charsetmax
- Buffer sizepublic BytesOf(CharSequence builder)
builder
- The sourcepublic BytesOf(CharSequence builder, Charset cset)
builder
- The sourcecset
- The charsetpublic BytesOf(char... chars)
chars
- The charspublic BytesOf(char[] chars, Charset cset)
chars
- The charscset
- The charsetpublic BytesOf(String source)
source
- The sourcepublic BytesOf(String source, Charset cset)
source
- The sourcecset
- The charsetpublic BytesOf(Text text)
text
- The sourcepublic BytesOf(Text text, Charset cset)
text
- The sourcecset
- The charsetpublic BytesOf(Throwable error)
error
- The exception to serializepublic BytesOf(byte... bytes)
bytes
- Bytes to encapsulatepublic byte[] asBytes() throws IOException
Bytes
asBytes
in interface Bytes
IOException
- If failsCopyright © 2017 Cactoos. All rights reserved.