Class ArrayOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.derby.iapi.services.io.ArrayOutputStream
-
-
Constructor Summary
Constructors Constructor Description ArrayOutputStream()ArrayOutputStream(byte[] data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intclearLimit()Clear any limit set by setLimit.intgetPosition()voidsetData(byte[] data)voidsetLimit(int length)Set the limit of the data that can be read or written.voidsetPosition(int newPosition)Set the position of the stream pointer.voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Method Detail
-
setData
public void setData(byte[] data)
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
getPosition
public int getPosition()
-
setPosition
public void setPosition(int newPosition) throws java.io.IOExceptionSet the position of the stream pointer.- Throws:
java.io.IOException
-
setLimit
public void setLimit(int length) throws java.io.IOExceptionDescription copied from interface:LimitSet the limit of the data that can be read or written. After this call up to and including length bytes can be read from or skipped in the stream.On input classes (e.g. InputStreams) any attempt to read or skip beyond the limit will result in an end of file indication (e.g. read() methods returning -1 or throwing EOFException).
On output classes (e.g. OutputStream) any attempt to write more beyond the limit will result in an EOFException
-
clearLimit
public int clearLimit()
Description copied from interface:LimitClear any limit set by setLimit. After this call no limit checking will be made on any read until a setLimit()) call is made.- Specified by:
clearLimitin interfaceLimit- Returns:
- the number of bytes within the limit that have not been read or written.
-
-