|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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);
}
Method Summary | |
---|---|
boolean |
eof()
returns true if the stream has reached its end |
int |
read(byte[] data,
int offset,
int length)
read data into the byte array starting at offset |
int |
write(byte[] data,
int offset,
int length)
write data into the byte array starting at offset, maximum bytes read are (data.length-offset) |
Method Detail |
---|
boolean eof()
int write(byte[] data, int offset, int length) throws IOException
data
- byte[] - the array to read data intooffset
- int - start position for writing data
IOException
int read(byte[] data, int offset, int length) throws IOException
data
- byte[] - the array to read data intooffset
- int - start position for writing datalength
- - the desired read length
IOException
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |