public class StringInputStream
extends java.io.InputStream
String
Modifier and Type | Field and Description |
---|---|
private java.io.ByteArrayInputStream |
byteArrayInputStream
Stream for read
String bytes |
Constructor and Description |
---|
StringInputStream(java.lang.String string)
Create a new instance of StringInputStream
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Number of available bytes
Parent documentation: |
void |
close()
Close the stream
Parent documentation: |
void |
mark(int readlimit)
Mark current reading position
Parent documentation: |
boolean |
markSupported()
Indicates if mark are supported
Parent documentation: |
int |
read()
Read one byte
Parent documentation: |
int |
read(byte[] b)
Read some bytes and fill an array.
|
int |
read(byte[] array,
int offset,
int length)
Read some bytes and fill a part of array
Parent documentation: |
void |
reset()
Reset the stream
Parent documentation: |
long |
skip(long n)
Skip a number of bytes
Parent documentation: |
private final java.io.ByteArrayInputStream byteArrayInputStream
String
bytespublic StringInputStream(java.lang.String string)
string
- String
to readpublic int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
- On reading issueInputStream.available()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
- On closing issueInputStream.close()
public void mark(int readlimit)
mark
in class java.io.InputStream
readlimit
- Read limitInputStream.mark(int)
public boolean markSupported()
markSupported
in class java.io.InputStream
true
if mark are supportedInputStream.markSupported()
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- On reading issueInputStream.read()
public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
b
- Array to filljava.io.IOException
- On reading issueInputStream.read(byte[])
public int read(byte[] array, int offset, int length) throws java.io.IOException
read
in class java.io.InputStream
array
- Array to filloffset
- Offset to start write in arraylength
- Number of byte to readjava.io.IOException
- On reading issueInputStream.read(byte[], int, int)
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
- On resting issueInputStream.reset()
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
n
- Number of bytes to skipjava.io.IOException
- On skipping issueInputStream.skip(long)