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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetEncoding(String aEncoding) voidsetInputStream(InputStream aInputStream) toString()toString(InputStream aInputStream) TheStringbeing build by the builder upon the settings of the attributes.toString(InputStream aInputStream, String aEncoding) TheStringbeing build by the builder upon the settings of the attributes.TheStrings being build by the builder upon the settings of the attributes.String[]TheStrings being build by the builder upon the settings of the attributes.String[]toStrings(InputStream aInputStream) TheStrings being build by the builder upon the settings of the attributes.String[]toStrings(InputStream aInputStream, String aEncoding) TheStrings being build by the builder upon the settings of the attributes.String[]TheStrings 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, waitMethods inherited from interface org.refcodes.mixin.EncodingAccessor.EncodingProperty
letEncodingMethods inherited from interface org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
letInputStream
-
Constructor Details
-
InputStreamStringBuilder
public InputStreamStringBuilder()
-
-
Method Details
-
withEncoding
- Specified by:
withEncodingin interfaceorg.refcodes.mixin.EncodingAccessor.EncodingBuilder<String,InputStreamStringBuilder>
-
withInputStream
- Specified by:
withInputStreamin interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<InputStreamStringBuilder>
-
toString
TheStringbeing build by the builder upon the settings of the attributes.- Parameters:
aInputStream- TheInputStreamwhich to convert into aString.- Returns:
- The according resulting
String - Throws:
IOException- thrown in case accessing theInputStreamcaused faults.
-
toStrings
TheStrings being build by the builder upon the settings of the attributes.- Parameters:
aInputStream- TheInputStreamwhich to convert into aStringarray.- Returns:
- The according resulting
Stringarray - Throws:
IOException- thrown in case accessing theInputStreamcaused faults.
-
getEncoding
- Specified by:
getEncodingin interfaceorg.refcodes.mixin.EncodingAccessor<String>
-
setEncoding
- Specified by:
setEncodingin interfaceorg.refcodes.mixin.EncodingAccessor.EncodingMutator<String>
-
getInputStream
- Specified by:
getInputStreamin interfaceorg.refcodes.mixin.InputStreamAccessor
-
setInputStream
- Specified by:
setInputStreamin interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamMutator
-
toString
TheStringbeing build by the builder upon the settings of the attributes.- Parameters:
aInputStream- TheInputStreamwhich to convert into aString.aEncoding- The text encoding to be used.- Returns:
- The according resulting
String - Throws:
IOException- thrown in case accessing theInputStreamcaused faults.
-
toString
-
toString
TheStrings being build by the builder upon the settings of the attributes.- Parameters:
aEncoding- The text encoding to be used.- Returns:
- The according resulting
Stringarray - Throws:
IOException- thrown in case accessing theInputStreamcaused faults.
-
toStrings
TheStrings being build by the builder upon the settings of the attributes.- Returns:
- The according resulting
Stringarray - Throws:
IOException- thrown in case accessing theInputStreamcaused faults.
-
toStrings
TheStrings being build by the builder upon the settings of the attributes.- Parameters:
aEncoding- The text encoding to be used.- Returns:
- The according resulting
Stringarray - Throws:
IOException- thrown in case accessing theInputStreamcaused faults.
-
toStrings
TheStrings being build by the builder upon the settings of the attributes.- Parameters:
aInputStream- TheInputStreamwhich to convert into aStringarray.aEncoding- The text encoding to be used.- Returns:
- The according resulting
Stringarray - Throws:
IOException- thrown in case accessing theInputStreamcaused faults.
-