- 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>
TheInputStreamStringBuilderconstructsStringinstances fromInputStreaminstances. Either usesetInputStream(InputStream)(withInputStream(InputStream)) followed by aObject.toString()method (not thread safe) or directly calltoString(InputStream)(thread safe). You may specify an encoding to be used such as UTF-8 by either setting the encoding attribute withEncodingAccessor.EncodingMutator.setEncoding(Object)(withEncoding(String)) or by passing the encoding to the conversion method as oftoString(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 Constructor Description InputStreamStringBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetEncoding()InputStreamgetInputStream()voidsetEncoding(String aEncoding)voidsetInputStream(InputStream aInputStream)StringtoString()StringtoString(InputStream aInputStream)TheStringbeing build by the builder upon the settings of the attributes.StringtoString(InputStream aInputStream, String aEncoding)TheStringbeing build by the builder upon the settings of the attributes.StringtoString(String aEncoding)TheStrings being build by the builder upon the settings of the attributes.String[]toStrings()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[]toStrings(String aEncoding)TheStrings being build by the builder upon the settings of the attributes.InputStreamStringBuilderwithEncoding(String aEncoding)InputStreamStringBuilderwithInputStream(InputStream aInputStream)
-
-
-
Method Detail
-
withEncoding
public InputStreamStringBuilder withEncoding(String aEncoding)
- Specified by:
withEncodingin interfaceorg.refcodes.mixin.EncodingAccessor.EncodingBuilder<String,InputStreamStringBuilder>
-
withInputStream
public InputStreamStringBuilder withInputStream(InputStream aInputStream)
- Specified by:
withInputStreamin interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<InputStreamStringBuilder>
-
toString
public String toString(InputStream aInputStream) throws IOException
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
public String[] toStrings(InputStream aInputStream) throws IOException
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
public String getEncoding()
- Specified by:
getEncodingin interfaceorg.refcodes.mixin.EncodingAccessor<String>
-
setEncoding
public void setEncoding(String aEncoding)
- Specified by:
setEncodingin interfaceorg.refcodes.mixin.EncodingAccessor.EncodingMutator<String>
-
getInputStream
public InputStream getInputStream()
- Specified by:
getInputStreamin interfaceorg.refcodes.mixin.InputStreamAccessor
-
setInputStream
public void setInputStream(InputStream aInputStream)
- Specified by:
setInputStreamin interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamMutator
-
toString
public String toString(InputStream aInputStream, String aEncoding) throws IOException
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
public String toString(String aEncoding) throws IOException
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
public String[] toStrings() throws IOException
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
public String[] toStrings(String aEncoding) throws IOException
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
public String[] toStrings(InputStream aInputStream, String aEncoding) throws IOException
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.
-
-