|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.quercus.env.Value
com.caucho.quercus.env.ResourceValue
com.caucho.quercus.resources.StreamResource
com.caucho.quercus.lib.file.FileValue
com.caucho.quercus.lib.file.FileReadValue
public class FileReadValue
Represents a Quercus open file
Field Summary |
---|
Fields inherited from class com.caucho.quercus.env.Value |
---|
L, NULL_ARGS, NULL_VALUE_ARRAY |
Constructor Summary | |
---|---|
FileReadValue(Path path)
|
Method Summary | |
---|---|
void |
close()
Closes the file. |
long |
getLength()
Returns the number of bytes available to be read, 0 if no known. |
long |
getPosition()
Returns the current location in the file. |
boolean |
isEOF()
Returns true on the EOF. |
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. |
StringValue |
readLine(Env env)
Reads a line from a file, returning null on EOF. |
boolean |
readOptionalLinefeed()
Reads the optional linefeed character from a \r\n |
java.lang.String |
toString()
Converts to a string. |
void |
writeToStream(java.io.OutputStream os,
int length)
Read a maximum of length bytes from the file and write them to the outputStream. |
Methods inherited from class com.caucho.quercus.lib.file.FileValue |
---|
getPath, print |
Methods inherited from class com.caucho.quercus.resources.StreamResource |
---|
closeRead, closeWrite, flush, print, write |
Methods inherited from class com.caucho.quercus.env.ResourceValue |
---|
cleanup, isResource, printRImpl, serialize, toKey, varDumpImpl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileReadValue(Path path) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public long getLength()
public int read() throws java.io.IOException
read
in class FileValue
java.io.IOException
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
read
in class StreamResource
java.io.IOException
public boolean readOptionalLinefeed() throws java.io.IOException
readOptionalLinefeed
in class StreamResource
java.io.IOException
public void writeToStream(java.io.OutputStream os, int length) throws java.io.IOException
FileValue
writeToStream
in class FileValue
os
- the OutputStream
length
- the maximum number of bytes to read
java.io.IOException
public StringValue readLine(Env env) throws java.io.IOException
readLine
in class FileValue
java.io.IOException
public boolean isEOF()
isEOF
in class StreamResource
public long getPosition()
getPosition
in class StreamResource
public void close()
close
in class FileValue
public java.lang.String toString()
toString
in class FileValue
env
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |