|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.quercus.lib.file.AbstractBinaryInputOutput
public class AbstractBinaryInputOutput
Represents a Quercus file open for reading
| Field Summary |
|---|
| Fields inherited from interface com.caucho.quercus.lib.file.BinaryStream |
|---|
SEEK_CUR, SEEK_END, SEEK_SET |
| Constructor Summary | |
|---|---|
protected |
AbstractBinaryInputOutput(Env env)
|
protected |
AbstractBinaryInputOutput(Env env,
ReadStream is,
WriteStream os)
|
| Method Summary | |
|---|---|
StringValue |
appendTo(StringValue builder)
Appends to a string builder. |
void |
close()
Closes the file. |
void |
closeRead()
Closes the stream for reading. |
void |
closeWrite()
Closes the file. |
void |
flush()
Flushes the output. |
protected Env |
getEnv()
|
java.io.InputStream |
getInputStream()
Returns the input stream. |
java.io.OutputStream |
getOutputStream()
Returns self as the output stream. |
long |
getPosition()
Returns the current location in the file. |
java.lang.String |
getResourceType()
|
void |
init(ReadStream is,
WriteStream os)
|
boolean |
isEOF()
Returns true on the EOF. |
BinaryInput |
openCopy()
Opens a copy. |
void |
print(char v)
Prints a string to a file. |
void |
print(java.lang.String v)
Prints a string to a file. |
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)
Sets the current read encoding. |
boolean |
setPosition(long offset)
Sets the current location in the file. |
void |
setTimeout(long timeout)
|
Value |
stat()
Returns an array filled with stat information. |
java.lang.Object |
toJavaObject()
|
java.lang.String |
toString()
Converts to a string. |
void |
unread()
Unread the last byte. |
void |
write(byte[] buffer,
int offset,
int length)
Writes a buffer. |
int |
write(java.io.InputStream is,
int length)
Read length bytes of data from the InputStream argument and write them to this output stream. |
void |
write(int ch)
|
void |
writeToStream(java.io.OutputStream os,
int length)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractBinaryInputOutput(Env env)
protected AbstractBinaryInputOutput(Env env,
ReadStream is,
WriteStream os)
| Method Detail |
|---|
public void init(ReadStream is,
WriteStream os)
public java.io.InputStream getInputStream()
getInputStream in interface BinaryInput
public BinaryInput openCopy()
throws java.io.IOException
openCopy in interface BinaryInputjava.io.IOException
public void setEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
BinaryInput
setEncoding in interface BinaryInputencoding - name of the read encoding
java.io.UnsupportedEncodingException
public void unread()
throws java.io.IOException
unread in interface BinaryInputjava.io.IOException
public int read()
throws java.io.IOException
read in interface BinaryInputjava.io.IOException
public int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in interface BinaryInputjava.io.IOException
public int read(char[] buffer,
int offset,
int length)
throws java.io.IOException
read in interface BinaryInputjava.io.IOException
public StringValue read(int length)
throws java.io.IOException
read in interface BinaryInputjava.io.IOException
public boolean readOptionalLinefeed()
throws java.io.IOException
readOptionalLinefeed in interface BinaryInputjava.io.IOException
public void writeToStream(java.io.OutputStream os,
int length)
throws java.io.IOException
java.io.IOException
public StringValue readLine(long length)
throws java.io.IOException
readLine in interface BinaryInputjava.io.IOException
public StringValue appendTo(StringValue builder)
throws java.io.IOException
appendTo 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 BinaryStream
public long seek(long offset,
int whence)
BinaryStream
seek in interface BinaryStreampublic Value stat()
BinaryStream
stat in interface BinaryStreampublic void closeRead()
closeRead in interface BinaryInputpublic java.io.OutputStream getOutputStream()
getOutputStream in interface BinaryOutput
public void write(int ch)
throws java.io.IOException
java.io.IOException
public void write(byte[] buffer,
int offset,
int length)
throws java.io.IOException
BinaryOutput
write in interface BinaryOutputjava.io.IOException
public int write(java.io.InputStream is,
int length)
write in interface BinaryOutput
public void print(char v)
throws java.io.IOException
print in interface BinaryOutputjava.io.IOException
public void print(java.lang.String v)
throws java.io.IOException
print in interface BinaryOutputjava.io.IOException
public void flush()
throws java.io.IOException
flush in interface BinaryOutputjava.io.IOExceptionpublic void closeWrite()
closeWrite in interface BinaryOutputpublic void close()
close in interface BinaryInputclose in interface BinaryOutputclose in interface BinaryStreampublic java.lang.Object toJavaObject()
public void setTimeout(long timeout)
public java.lang.String getResourceType()
protected Env getEnv()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||