java.lang.Object
java.io.OutputStream
org.apache.derby.iapi.services.io.ArrayOutputStream
- All Implemented Interfaces:
- Limit
- public class ArrayOutputStream
- extends java.io.OutputStream
- implements Limit
|
Method Summary |
int |
clearLimit()
Clear any limit set by setLimit. |
int |
getPosition()
|
void |
setData(byte[] data)
|
void |
setLimit(int length)
Set the limit of the data that can be read or written. |
void |
setPosition(int newPosition)
Set the position of the stream pointer. |
void |
write(byte[] b,
int off,
int len)
This method writes len bytes from the specified array
b starting at index off into the array. |
void |
write(int b)
This method writes a single byte to the output stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pageData
private byte[] pageData
start
private int start
end
private int end
position
private int position
ArrayOutputStream
public ArrayOutputStream()
ArrayOutputStream
public ArrayOutputStream(byte[] data)
setData
public void setData(byte[] data)
write
public void write(int b)
throws java.io.IOException
- Description copied from class:
java.io.OutputStream
- This method writes a single byte to the output stream. The byte written
is the low eight bits of the
int passed and a argument.
Subclasses must provide an implementation of this abstract method
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Description copied from class:
java.io.OutputStream
- This method writes
len bytes from the specified array
b starting at index off into the array.
This method in this class calls the single byte write()
method in a loop until all bytes have been written. Subclasses should
override this method if possible in order to provide a more efficent
implementation.
getPosition
public int getPosition()
setPosition
public void setPosition(int newPosition)
throws java.io.IOException
- Set the position of the stream pointer.
setLimit
public void setLimit(int length)
throws java.io.IOException
- Description copied from interface:
Limit
- Set 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
- Specified by:
setLimit in interface Limit
clearLimit
public int clearLimit()
- Description copied from interface:
Limit
- Clear 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:
clearLimit in interface Limit