com.imagero.uio.io
Class ByteArrayOutputStream2
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
com.imagero.uio.io.ByteArrayOutputStream2
- public class ByteArrayOutputStream2
- extends java.io.ByteArrayOutputStream
ByteArrayOutputStream which writes to external buffer.
Length of this external buffer can't be changed.
| Fields inherited from class java.io.ByteArrayOutputStream |
buf, count |
|
Method Summary |
int |
getCount()
|
void |
seek(int pos)
|
int |
skip(int n)
Skip some bytes.
|
void |
write(byte[] b,
int off,
int len)
Writes bytes from the specified byte array to buffer |
void |
write(int b)
write given byte to buffer. |
void |
write(int b,
int mask)
combine (OR) current value with given byte using supplied mask.
|
| Methods inherited from class java.io.ByteArrayOutputStream |
close, reset, size, toByteArray, toString, toString, toString, writeTo |
| Methods inherited from class java.io.OutputStream |
flush, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ByteArrayOutputStream2
public ByteArrayOutputStream2(byte[] buffer)
write
public void write(int b)
- write given byte to buffer.
- Parameters:
b - byte to write
- Throws:
java.lang.ArrayIndexOutOfBoundsException - if new byte count would exceed length of buffer after this operation
write
public void write(int b,
int mask)
- combine (OR) current value with given byte using supplied mask.
resulting value is (b & mask) | (currentValue & ~mask)
- Parameters:
b - byte to combinemask - 8 bit mask
- Throws:
java.lang.ArrayIndexOutOfBoundsException
write
public void write(byte[] b,
int off,
int len)
- Writes bytes from the specified byte array to buffer
- Parameters:
b - byte arrayoff - start offsetlen - number of bytes to write
- Throws:
java.lang.ArrayIndexOutOfBoundsException - if new byte count would exceed length of buffer after this operation (however the max possible byte count is written first)
getCount
public int getCount()
skip
public int skip(int n)
- Skip some bytes.
Negative skip is possible.
- Parameters:
n - byte count to skip
- Returns:
- how much bytes were skipped
seek
public void seek(int pos)