Class StringInputStreamProvider
java.lang.Object
com.helger.commons.io.streamprovider.StringInputStreamProvider
- All Implemented Interfaces:
IHasInputStream,IHasInputStreamAndReader,IHasReader
public class StringInputStreamProvider
extends Object
implements IHasInputStreamAndReader, IHasReader
An
InputStream provider based on a String.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionStringInputStreamProvider(char[] aChars, int nOfs, int nLen, Charset aCharset) StringInputStreamProvider(char[] aChars, Charset aCharset) StringInputStreamProvider(CharSequence aData, Charset aCharset) StringInputStreamProvider(String sData, Charset aCharset) -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal Charsetfinal StringgetData()final StringInputStreamGet the input stream to read from the object.final NonBlockingStringReaderGet the reader to read from the object.final NonBlockingStringReaderGet aReaderbased on this input stream provider using the given charset.inthashCode()final booleanCheck if theInputStreamfromIHasInputStream.getInputStream()andIHasInputStream.getBufferedInputStream()can be acquired more than once.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.io.IHasInputStream
getBufferedInputStream, withBufferedInputStreamDo, withInputStreamDoMethods inherited from interface com.helger.commons.io.IHasInputStreamAndReader
getBufferedReaderMethods inherited from interface com.helger.commons.io.IHasReader
getBufferedReader
-
Constructor Details
-
StringInputStreamProvider
-
StringInputStreamProvider
public StringInputStreamProvider(@Nonnull char[] aChars, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull Charset aCharset) -
StringInputStreamProvider
-
StringInputStreamProvider
-
-
Method Details
-
getData
-
getCharset
-
getInputStream
Description copied from interface:IHasInputStreamGet the input stream to read from the object. Each time this method is called, a newInputStreamneeds to be created.- Specified by:
getInputStreamin interfaceIHasInputStream- Returns:
nullif resolving failed.
-
getReader
Description copied from interface:IHasInputStreamAndReaderGet aReaderbased on this input stream provider using the given charset.- Specified by:
getReaderin interfaceIHasInputStreamAndReader- Parameters:
aCharset- The charset to use. May not benull.- Returns:
nullif no input stream could be retrieved.
-
getReader
Description copied from interface:IHasReaderGet the reader to read from the object. Each time this method is call, a newReaderneeds to be created!- Specified by:
getReaderin interfaceIHasReader- Returns:
nullif resolving failed.
-
isReadMultiple
public final boolean isReadMultiple()Description copied from interface:IHasInputStreamCheck if theInputStreamfromIHasInputStream.getInputStream()andIHasInputStream.getBufferedInputStream()can be acquired more than once.- Specified by:
isReadMultiplein interfaceIHasInputStream- Returns:
trueif the input stream can be acquired more than once,falseif not.
-
equals
-
hashCode
public int hashCode() -
toString
-