Package com.amazonaws.util
Class StringInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- com.amazonaws.util.StringInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class StringInputStream extends ByteArrayInputStream
Simple wrapper for ByteArrayInputStream that will automatically encode the string as UTF-8 data, and still allows access to the original string.
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos
-
-
Constructor Summary
Constructors Constructor Description StringInputStream(String s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getString()
Returns the original string specified when this input stream was constructed.-
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTo
-
Methods inherited from class java.io.InputStream
nullInputStream, read, readNBytes
-
-
-
-
Constructor Detail
-
StringInputStream
public StringInputStream(String s) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
-
Method Detail
-
getString
public String getString()
Returns the original string specified when this input stream was constructed.- Returns:
- The original string specified when this input stream was constructed.
-
-