|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream org.joe_e.array.ByteArray.BuilderOutputStream
public static final class ByteArray.BuilderOutputStream
A ByteArray
factory that extends OutputStream
.
All methods are simple wrappers around those provided by
ByteArray.Builder
.
Constructor Summary | |
---|---|
ByteArray.BuilderOutputStream()
Create an output stream using a new underlying ByteArray.Builder with
the default internal array length |
|
ByteArray.BuilderOutputStream(ByteArray.Builder toWrap)
Suppressed. Create an output stream that wraps the specified ByteArray.Builder |
|
ByteArray.BuilderOutputStream(int estimate)
Create an output stream using a new underlying ByteArray.Builder |
Method Summary | |
---|---|
int |
length()
Gets the number of bytes written to the underlying ByteArray.Builder |
ByteArray |
snapshot()
Create a snapshot of the current content. |
void |
write(byte[] b)
Append a byte array to the underlying ByteArray.Builder |
void |
write(byte[] b,
int off,
int len)
Append part of a byte array to the underlying
ByteArray.Builder |
void |
write(int b)
Append a byte to the underlying ByteArray.Builder |
Methods inherited from class java.io.OutputStream |
---|
close, flush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteArray.BuilderOutputStream()
ByteArray.Builder
with
the default internal array length
public ByteArray.BuilderOutputStream(int estimate)
ByteArray.Builder
estimate
- estimated array lengthpublic ByteArray.BuilderOutputStream(ByteArray.Builder toWrap)
ByteArray.Builder
toWrap
- the Builder
to wrapMethod Detail |
---|
public void write(int b)
byte
to the underlying ByteArray.Builder
write
in class OutputStream
b
- the element to addpublic void write(byte[] b)
byte
array to the underlying ByteArray.Builder
write
in class OutputStream
b
- the elements to addOutputStream.write(byte[], int, int)
public void write(byte[] b, int off, int len)
byte
array to the underlying
ByteArray.Builder
write
in class OutputStream
b
- the elements to addoff
- the index of the first element to addlen
- the number of elements to addpublic int length()
ByteArray.Builder
public ByteArray snapshot()
ByteArray
containing the elements so far
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |