public final class BytesAsText extends Object implements Text
This class is doing something similar to what ExceptionUtils are doing from Apache Commons.
There is no thread-safety guarantee.
Text.NoNulls
Constructor and Description |
---|
BytesAsText(byte[] bts)
Ctor.
|
BytesAsText(byte[] bts,
Charset cset)
Ctor.
|
BytesAsText(Bytes bts)
Ctor.
|
BytesAsText(Bytes bts,
Charset cset)
Ctor.
|
BytesAsText(Input input)
Ctor.
|
BytesAsText(Input input,
Charset cset)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
String |
asString()
Convert it to the string.
|
int |
compareTo(Text text) |
public BytesAsText(Input input)
input
- Bytes from the inputpublic BytesAsText(byte[] bts)
bts
- Bytes to encapsulatepublic BytesAsText(Bytes bts)
bts
- Bytes to encapsulatepublic BytesAsText(Input input, Charset cset)
input
- Inputcset
- Charsetpublic BytesAsText(byte[] bts, Charset cset)
bts
- Bytes to encapsulatecset
- Charsetpublic String asString() throws IOException
Text
asString
in interface Text
IOException
- If failspublic int compareTo(Text text)
compareTo
in interface Comparable<Text>
Copyright © 2017 Cactoos. All rights reserved.