| org.apache.catalina.tribes.tipis.Streamable
Streamable | public interface Streamable (Code) | | Example usage:
byte[] data = new byte[1024];
Streamable st = ....;
while ( !st.eof() ) {
int length = st.read(data,0,data.length);
String s = new String(data,0,length);
System.out.println(s);
}
author: Filip Hanik version: 1.0 |
Method Summary | |
public boolean | eof() | public int | read(byte[] data, int offset, int length) | public int | write(byte[] data, int offset, int length) |
eof | public boolean eof()(Code) | | returns true if the stream has reached its end
boolean |
read | public int read(byte[] data, int offset, int length) throws IOException(Code) | | read data into the byte array starting at offset
Parameters: data - byte[] - the array to read data into Parameters: offset - int - start position for writing data Parameters: length - - the desired read length int - the number of bytes read from the data buffer |
write | public int write(byte[] data, int offset, int length) throws IOException(Code) | | write data into the byte array starting at offset, maximum bytes read are (data.length-offset)
Parameters: data - byte[] - the array to read data into Parameters: offset - int - start position for writing data int - the number of bytes written into the data buffer |
|
|