wt.federation
Class FederatedHttpInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended bywt.federation.FederatedHttpInputStream
All Implemented Interfaces:
Serializable

public class FederatedHttpInputStream
extends InputStream
implements Serializable



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  byte[] buffer
           
private  int bufferCursor
           
private  int bufferLimit
           
private  int bufferSize
           
private static String CLASSNAME
           
private  boolean finalBoundary
           
private static String RESOURCE
           
private  InputStream stream
           
 
Fields inherited from class java.io.InputStream
 
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
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

buffer

private byte[] buffer

bufferCursor

private int bufferCursor

bufferLimit

private int bufferLimit

bufferSize

private int bufferSize

finalBoundary

private boolean finalBoundary

stream

private InputStream stream
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

Returns:
int
Throws:
IOException

close

public void close()
           throws IOException
Closes the stream.

Supported API: true

Throws:
IOException

read

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

Supported API: true

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

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

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

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

Returns:
boolean