FileDocCategorySizeDatePackage
Streamable.javaAPI DocApache Tomcat 6.0.142198Fri Jul 20 04:20:36 BST 2007org.apache.catalina.tribes.tipis

Streamable

public interface Streamable
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

Fields Summary
Constructors Summary
Methods Summary
public booleaneof()
returns true if the stream has reached its end

return
boolean

public intread(byte[] data, int offset, int length)
read data into the byte array starting at offset

param
data byte[] - the array to read data into
param
offset int - start position for writing data
param
length - the desired read length
return
int - the number of bytes read from the data buffer

public intwrite(byte[] data, int offset, int length)
write data into the byte array starting at offset, maximum bytes read are (data.length-offset)

param
data byte[] - the array to read data into
param
offset int - start position for writing data
return
int - the number of bytes written into the data buffer