- 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>
TheInputStreamStringBuilder
constructsString
instances fromInputStream
instances. 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 String
getEncoding()
InputStream
getInputStream()
void
setEncoding(String aEncoding)
void
setInputStream(InputStream aInputStream)
String
toString()
String
toString(InputStream aInputStream)
TheString
being build by the builder upon the settings of the attributes.String
toString(InputStream aInputStream, String aEncoding)
TheString
being build by the builder upon the settings of the attributes.String
toString(String aEncoding)
TheString
s being build by the builder upon the settings of the attributes.String[]
toStrings()
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[]
toStrings(String aEncoding)
TheString
s being build by the builder upon the settings of the attributes.InputStreamStringBuilder
withEncoding(String aEncoding)
InputStreamStringBuilder
withInputStream(InputStream aInputStream)
-
-
-
Method Detail
-
withEncoding
public InputStreamStringBuilder withEncoding(String aEncoding)
- Specified by:
withEncoding
in interfaceorg.refcodes.mixin.EncodingAccessor.EncodingBuilder<String,InputStreamStringBuilder>
-
withInputStream
public InputStreamStringBuilder withInputStream(InputStream aInputStream)
- Specified by:
withInputStream
in interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<InputStreamStringBuilder>
-
toString
public String toString(InputStream aInputStream) throws IOException
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
public String[] toStrings(InputStream aInputStream) throws IOException
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
public String getEncoding()
- Specified by:
getEncoding
in interfaceorg.refcodes.mixin.EncodingAccessor<String>
-
setEncoding
public void setEncoding(String aEncoding)
- Specified by:
setEncoding
in interfaceorg.refcodes.mixin.EncodingAccessor.EncodingMutator<String>
-
getInputStream
public InputStream getInputStream()
- Specified by:
getInputStream
in interfaceorg.refcodes.mixin.InputStreamAccessor
-
setInputStream
public void setInputStream(InputStream aInputStream)
- Specified by:
setInputStream
in interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamMutator
-
toString
public String toString(InputStream aInputStream, String aEncoding) throws IOException
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
public String toString(String aEncoding) throws IOException
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
public String[] toStrings() throws IOException
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
public String[] toStrings(String aEncoding) throws IOException
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
public String[] toStrings(InputStream aInputStream, String aEncoding) throws IOException
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.
-
-