wt.federation
Class FederatedHttpInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by wt.federation.FederatedHttpInputStream
All Implemented Interfaces:
Closeable, Serializable

public class FederatedHttpInputStream
extends InputStream
implements Serializable



Supported API: true

Extendable: false

See Also:
Serialized Form

Constructor Summary
FederatedHttpInputStream(InputStream inputStream)
          Constructor returning an instance initialized with the specified input stream.
 
Method Summary
 int available()
          Returns the number of bytes that can be read without blocking.
 void close()
          Closes the stream.
 boolean isFinalBoundary()
          Returns true if the last call to readUntilBoundary detected the final boundary of a MIME multipart object.
 boolean markSupported()
          Indicates whether mark and reset methods are supported.
 int read()
          Reads and returns the next byte.
 int read(byte[] b)
          Reads bytes into the specified buffer.
 int read(byte[] b, int off, int len)
          Reads bytes into the specified buffer at the specified position with specified maximum length.
 byte[] readBytesUntilBoundary(String boundary)
          Reads octets until a specified MIME boundary is detected.
 byte[] readBytesUntilEnd()
          Reads octets until end of file is detected.
 int readBytesUntilFull(byte[] bytes)
          Reads octets until the specified array is full or end of file is reached.
 String readLine()
          Reads the next line, returning the line as a String.
 long skip(long n)
          Skips and discards the specified number of bytes.
 
Methods inherited from class java.io.InputStream
mark, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FederatedHttpInputStream

public FederatedHttpInputStream(InputStream inputStream)
Constructor returning an instance initialized with the specified input stream.

Supported API: true

Parameters:
inputStream -
Method Detail

available

public int available()
              throws IOException
Returns the number of bytes that can be read without blocking.

Supported API: true

Overrides:
available in class InputStream
Returns:
int
Throws:
IOException

close

public void close()
           throws IOException
Closes the stream.

Supported API: true

Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

read

public int read()
         throws IOException
Reads and returns the next byte. Returns -1 if end of file reached.

Supported API: true

Specified by:
read in class InputStream
Returns:
int
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Reads bytes into the specified buffer. Returns the number of bytes read, or -1 if end of file has been reached.

Supported API: true

Overrides:
read in class InputStream
Parameters:
b -
Returns:
int
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Reads bytes into the specified buffer at the specified position with specified maximum length. Returns the number of bytes read, or -1 if end of file reached.

Supported API: true

Overrides:
read in class InputStream
Parameters:
b -
off -
len -
Returns:
int
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Skips and discards the specified number of bytes.

Supported API: true

Overrides:
skip in class InputStream
Parameters:
n -
Returns:
long
Throws:
IOException

readLine

public String readLine()
                throws IOException
Reads the next line, returning the line as a String.

Supported API: true

Returns:
String
Throws:
IOException

readBytesUntilBoundary

public byte[] readBytesUntilBoundary(String boundary)
                              throws IOException
Reads octets until a specified MIME boundary is detected. Returns a byte array containing the bytes read, not including the boundary.

Supported API: true

Parameters:
boundary -
Returns:
byte []
Throws:
IOException

readBytesUntilEnd

public byte[] readBytesUntilEnd()
                         throws IOException
Reads octets until end of file is detected. Returns a byte array containing the bytes read.

Supported API: true

Returns:
byte []
Throws:
IOException

readBytesUntilFull

public int readBytesUntilFull(byte[] bytes)
                       throws IOException
Reads octets until the specified array is full or end of file is reached.

Supported API: true

Parameters:
bytes -
Returns:
int
Throws:
IOException

isFinalBoundary

public boolean isFinalBoundary()
Returns true if the last call to readUntilBoundary detected the final boundary of a MIME multipart object.

Supported API: true

Returns:
boolean

markSupported

public boolean markSupported()
Indicates whether mark and reset methods are supported. Currently returns false.

Supported API: true

Overrides:
markSupported in class InputStream
Returns:
boolean