java.lang.Object
org.refcodes.io.InputStreamStringBuilder
- All Implemented Interfaces:
org.refcodes.mixin.EncodingAccessor<String>
,org.refcodes.mixin.EncodingAccessor.EncodingBuilder<String,
,InputStreamStringBuilder> org.refcodes.mixin.EncodingAccessor.EncodingMutator<String>
,org.refcodes.mixin.EncodingAccessor.EncodingProperty<String>
,org.refcodes.mixin.InputStreamAccessor
,org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<InputStreamStringBuilder>
,org.refcodes.mixin.InputStreamAccessor.InputStreamMutator
,org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
public class InputStreamStringBuilder
extends Object
implements org.refcodes.mixin.InputStreamAccessor.InputStreamProperty, org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<InputStreamStringBuilder>, org.refcodes.mixin.EncodingAccessor.EncodingProperty<String>, org.refcodes.mixin.EncodingAccessor.EncodingBuilder<String,InputStreamStringBuilder>
The
InputStreamStringBuilder
constructs String
instances from
InputStream
instances. Either use
setInputStream(InputStream)
(withInputStream(InputStream)
)
followed by a Object.toString()
method (not thread safe) or directly
call toString(InputStream)
(thread safe). You may specify an
encoding to be used such as UTF-8 by either setting the encoding attribute
with EncodingAccessor.EncodingMutator.setEncoding(Object)
(withEncoding(String)
) or by
passing the encoding to the conversion method as of toString(String)
which overrules the encoding attribute.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.EncodingAccessor
org.refcodes.mixin.EncodingAccessor.EncodingBuilder<E extends Object,
B extends org.refcodes.mixin.EncodingAccessor.EncodingBuilder<E, B>>, org.refcodes.mixin.EncodingAccessor.EncodingMutator<E extends Object>, org.refcodes.mixin.EncodingAccessor.EncodingProperty<E extends Object> Nested classes/interfaces inherited from interface org.refcodes.mixin.InputStreamAccessor
org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setEncoding
(String aEncoding) void
setInputStream
(InputStream aInputStream) toString()
toString
(InputStream aInputStream) TheString
being build by the builder upon the settings of the attributes.toString
(InputStream aInputStream, String aEncoding) TheString
being build by the builder upon the settings of the attributes.TheString
s being build by the builder upon the settings of the attributes.String[]
TheString
s being build by the builder upon the settings of the attributes.String[]
toStrings
(InputStream aInputStream) TheString
s being build by the builder upon the settings of the attributes.String[]
toStrings
(InputStream aInputStream, String aEncoding) TheString
s being build by the builder upon the settings of the attributes.String[]
TheString
s being build by the builder upon the settings of the attributes.withEncoding
(String aEncoding) withInputStream
(InputStream aInputStream) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.EncodingAccessor.EncodingProperty
letEncoding
Methods inherited from interface org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
letInputStream
-
Constructor Details
-
InputStreamStringBuilder
public InputStreamStringBuilder()
-
-
Method Details
-
withEncoding
- Specified by:
withEncoding
in interfaceorg.refcodes.mixin.EncodingAccessor.EncodingBuilder<String,
InputStreamStringBuilder>
-
withInputStream
- Specified by:
withInputStream
in interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<InputStreamStringBuilder>
-
toString
TheString
being build by the builder upon the settings of the attributes.- Parameters:
aInputStream
- TheInputStream
which to convert into aString
.- Returns:
- The according resulting
String
- Throws:
IOException
- thrown in case accessing theInputStream
caused faults.
-
toStrings
TheString
s being build by the builder upon the settings of the attributes.- Parameters:
aInputStream
- TheInputStream
which to convert into aString
array.- Returns:
- The according resulting
String
array - Throws:
IOException
- thrown in case accessing theInputStream
caused faults.
-
getEncoding
- Specified by:
getEncoding
in interfaceorg.refcodes.mixin.EncodingAccessor<String>
-
setEncoding
- Specified by:
setEncoding
in interfaceorg.refcodes.mixin.EncodingAccessor.EncodingMutator<String>
-
getInputStream
- Specified by:
getInputStream
in interfaceorg.refcodes.mixin.InputStreamAccessor
-
setInputStream
- Specified by:
setInputStream
in interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamMutator
-
toString
TheString
being build by the builder upon the settings of the attributes.- Parameters:
aInputStream
- TheInputStream
which to convert into aString
.aEncoding
- The text encoding to be used.- Returns:
- The according resulting
String
- Throws:
IOException
- thrown in case accessing theInputStream
caused faults.
-
toString
-
toString
TheString
s being build by the builder upon the settings of the attributes.- Parameters:
aEncoding
- The text encoding to be used.- Returns:
- The according resulting
String
array - Throws:
IOException
- thrown in case accessing theInputStream
caused faults.
-
toStrings
TheString
s being build by the builder upon the settings of the attributes.- Returns:
- The according resulting
String
array - Throws:
IOException
- thrown in case accessing theInputStream
caused faults.
-
toStrings
TheString
s being build by the builder upon the settings of the attributes.- Parameters:
aEncoding
- The text encoding to be used.- Returns:
- The according resulting
String
array - Throws:
IOException
- thrown in case accessing theInputStream
caused faults.
-
toStrings
TheString
s being build by the builder upon the settings of the attributes.- Parameters:
aInputStream
- TheInputStream
which to convert into aString
array.aEncoding
- The text encoding to be used.- Returns:
- The according resulting
String
array - Throws:
IOException
- thrown in case accessing theInputStream
caused faults.
-