public class ReadStreamInput extends java.io.InputStream implements BinaryInput
SEEK_CUR, SEEK_END, SEEK_SET| Modifier | Constructor and Description |
|---|---|
|
ReadStreamInput(Env env) |
|
ReadStreamInput(Env env,
java.io.InputStream is) |
protected |
ReadStreamInput(Env env,
LineReader lineReader) |
protected |
ReadStreamInput(Env env,
LineReader lineReader,
ReadStream is) |
| Modifier and Type | Method and Description |
|---|---|
StringValue |
appendTo(StringValue builder)
Appends to a string builder.
|
void |
close()
Closes the file.
|
void |
closeRead()
Closes the stream for reading.
|
int |
getAvailable() |
java.io.InputStream |
getInputStream()
Returns the input stream.
|
long |
getPosition()
Returns the current location in the file.
|
java.lang.String |
getResourceType() |
void |
init(ReadStream is) |
boolean |
isEOF()
Returns true on the EOF.
|
BinaryInput |
openCopy()
Opens a copy.
|
int |
read()
Reads a character from a file, returning -1 on EOF.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads a buffer from a file, returning -1 on EOF.
|
int |
read(char[] buffer,
int offset,
int length)
Reads a buffer from a file, returning -1 on EOF.
|
StringValue |
read(int length)
Reads into a binary builder.
|
StringValue |
readLine(long length)
Reads a line from a file, returning null on EOF.
|
boolean |
readOptionalLinefeed()
Reads the optional linefeed character from a \r\n
|
long |
seek(long offset,
int whence)
Seek according to offset and whence.
|
void |
setEncoding(java.lang.String encoding) |
boolean |
setPosition(long offset)
Returns the current location in the file.
|
Value |
stat()
Returns an array filled with stat information.
|
java.lang.Object |
toJavaObject() |
java.lang.String |
toString()
Converts to a string.
|
void |
unread()
Unreads the last byte.
|
void |
writeToStream(java.io.OutputStream os,
int length) |
public ReadStreamInput(Env env)
public ReadStreamInput(Env env, java.io.InputStream is)
protected ReadStreamInput(Env env, LineReader lineReader)
protected ReadStreamInput(Env env, LineReader lineReader, ReadStream is)
public void init(ReadStream is)
public java.io.InputStream getInputStream()
getInputStream in interface BinaryInputpublic BinaryInput openCopy() throws java.io.IOException
openCopy in interface BinaryInputjava.io.IOExceptionpublic void setEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic void unread()
throws java.io.IOException
BinaryInputunread in interface BinaryInputjava.io.IOExceptionpublic int getAvailable()
throws java.io.IOException
getAvailable in interface BinaryInputjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in interface BinaryInputread in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in interface BinaryInputread in class java.io.InputStreamjava.io.IOExceptionpublic int read(char[] buffer,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionpublic StringValue read(int length) throws java.io.IOException
read in interface BinaryInputjava.io.IOExceptionpublic boolean readOptionalLinefeed()
throws java.io.IOException
readOptionalLinefeed in interface BinaryInputjava.io.IOExceptionpublic void writeToStream(java.io.OutputStream os,
int length)
throws java.io.IOException
java.io.IOExceptionpublic StringValue appendTo(StringValue builder)
appendTo in interface BinaryInputpublic StringValue readLine(long length) throws java.io.IOException
readLine in interface BinaryInputjava.io.IOExceptionpublic boolean isEOF()
isEOF in interface BinaryStreampublic long getPosition()
getPosition in interface BinaryInputgetPosition in interface BinaryStreampublic boolean setPosition(long offset)
setPosition in interface BinaryInputsetPosition in interface BinaryStreampublic long seek(long offset,
int whence)
BinaryStreamseek in interface BinaryStreampublic Value stat()
BinaryStreamstat in interface BinaryStreampublic void closeRead()
closeRead in interface BinaryInputpublic void close()
close in interface BinaryInputclose in interface BinaryStreamclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreampublic java.lang.Object toJavaObject()
public java.lang.String getResourceType()
public java.lang.String toString()
toString in class java.lang.Object