Package i2p.susi.util
Class ReadBuffer
java.lang.Object
i2p.susi.util.ReadBuffer
- All Implemented Interfaces:
Buffer
public class ReadBuffer extends Object implements Buffer
Input only for constant data, initialized from a byte array.
See MemoryBuffer for read/write.
- Author:
- susi
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ReadBuffer(byte[] content, int offset, int length)
-
Method Summary
Modifier and Type Method Description InputStream
getInputStream()
int
getLength()
Always validint
getOffset()
Always validOutputStream
getOutputStream()
void
readComplete(boolean success)
Does nothingString
toString()
void
writeComplete(boolean success)
Does nothing
-
Field Details
-
Constructor Details
-
ReadBuffer
public ReadBuffer(byte[] content, int offset, int length)
-
-
Method Details
-
getInputStream
- Specified by:
getInputStream
in interfaceBuffer
- Returns:
- new ByteArrayInputStream over the content
- Since:
- 0.9.34
-
getOutputStream
- Specified by:
getOutputStream
in interfaceBuffer
- Throws:
IllegalStateException
- always- Since:
- 0.9.34
-
readComplete
public void readComplete(boolean success)Does nothing- Specified by:
readComplete
in interfaceBuffer
- Since:
- 0.9.34
-
writeComplete
public void writeComplete(boolean success)Does nothing- Specified by:
writeComplete
in interfaceBuffer
- Parameters:
success
- if false, deletes any resources- Since:
- 0.9.34
-
getLength
public int getLength()Always valid -
getOffset
public int getOffset()Always valid -
toString
-