com.caucho.quercus.lib.file
Interface BinaryInput

All Superinterfaces:
BinaryStream
All Known Subinterfaces:
SocketInputOutput
All Known Implementing Classes:
AbstractBinaryInput, AbstractBinaryInputOutput, BufferedBinaryInputOutput, FileInput, FileInputOutput, HttpInputOutput, PhpBinaryInput, PhpStdin, PopenInput, ProcOpenInput, ReadStreamInput, TcpInputOutput, UdpInputOutput, WrappedStream, ZipEntryInputStream, ZlibInputStream

public interface BinaryInput
extends BinaryStream

Interface for a Quercus binary input stream


Field Summary
 
Fields inherited from interface com.caucho.quercus.lib.file.BinaryStream
SEEK_CUR, SEEK_END, SEEK_SET
 
Method Summary
 StringValue appendTo(StringValue builder)
          Appends to a string builder.
 void close()
          Closes the stream.
 void closeRead()
          Closes the stream for reading
 java.io.InputStream getInputStream()
          Returns an InputStream to the input.
 long getPosition()
          Returns the current location in the stream
 BinaryInput openCopy()
          Opens a new copy.
 int read()
          Reads the next byte, returning -1 on eof.
 int read(byte[] buffer, int offset, int length)
          Reads into a buffer, returning -1 on eof.
 StringValue read(int length)
          Reads a Binary string.
 StringValue readLine(long length)
          Reads a line from the buffer.
 boolean readOptionalLinefeed()
          Reads the optional linefeed character from a \r\n
 boolean setPosition(long offset)
          Sets the current location in the stream
 void unread()
          Unreads the last byte.
 
Methods inherited from interface com.caucho.quercus.lib.file.BinaryStream
isEOF, seek, stat
 

Method Detail

getInputStream

java.io.InputStream getInputStream()
Returns an InputStream to the input.


openCopy

BinaryInput openCopy()
                     throws java.io.IOException
Opens a new copy.

Throws:
java.io.IOException

read

int read()
         throws java.io.IOException
Reads the next byte, returning -1 on eof.

Throws:
java.io.IOException

unread

void unread()
            throws java.io.IOException
Unreads the last byte.

Throws:
java.io.IOException

read

int read(byte[] buffer,
         int offset,
         int length)
         throws java.io.IOException
Reads into a buffer, returning -1 on eof.

Throws:
java.io.IOException

read

StringValue read(int length)
                 throws java.io.IOException
Reads a Binary string.

Throws:
java.io.IOException

readOptionalLinefeed

boolean readOptionalLinefeed()
                             throws java.io.IOException
Reads the optional linefeed character from a \r\n

Throws:
java.io.IOException

readLine

StringValue readLine(long length)
                     throws java.io.IOException
Reads a line from the buffer.

Throws:
java.io.IOException

appendTo

StringValue appendTo(StringValue builder)
                     throws java.io.IOException
Appends to a string builder.

Throws:
java.io.IOException

getPosition

long getPosition()
Returns the current location in the stream

Specified by:
getPosition in interface BinaryStream

setPosition

boolean setPosition(long offset)
Sets the current location in the stream

Specified by:
setPosition in interface BinaryStream

close

void close()
Closes the stream.

Specified by:
close in interface BinaryStream

closeRead

void closeRead()
Closes the stream for reading