public final class ByteOutputStream
extends java.io.OutputStream
BufferedOutputStream
.
Compared to BufferedOutputStream
,
this class:
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buf
The buffer where data is stored.
|
protected int |
count
The number of valid bytes in the buffer.
|
Constructor and Description |
---|
ByteOutputStream() |
ByteOutputStream(int size) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
byte[] |
getBytes() |
int |
getCount() |
ByteInputStream |
newInputStream() |
void |
reset() |
int |
size() |
byte[] |
toByteArray()
Deprecated.
because this is evil!
|
java.lang.String |
toString()
Converts the buffer's contents into a string, translating bytes into
characters according to the platform's default character encoding.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(java.io.InputStream in)
Copies all the bytes from this input into this buffer.
|
void |
write(int b) |
void |
writeAsAscii(java.lang.String s)
Writes a string as ASCII string.
|
void |
writeTo(java.io.OutputStream out) |
protected byte[] buf
protected int count
public ByteOutputStream()
public ByteOutputStream(int size)
public void write(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public void write(int b)
write
in class java.io.OutputStream
public void write(byte[] b, int off, int len)
write
in class java.io.OutputStream
public void write(byte[] b)
write
in class java.io.OutputStream
public void writeAsAscii(java.lang.String s)
public void writeTo(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void reset()
public byte[] toByteArray()
public int size()
public ByteInputStream newInputStream()
public java.lang.String toString()
toString
in class java.lang.Object
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
public byte[] getBytes()
public int getCount()
Copyright © 2013 Oracle. All Rights Reserved.