java.lang.Object
java.io.OutputStream
com.sun.xml.messaging.saaj.util.ByteOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Customized
BufferedOutputStream.
Compared to BufferedOutputStream,
this class:
- doesn't do synchronization
- allows access to the raw buffer
- almost no parameter check
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()byte[]getBytes()intgetCount()voidreset()intsize()byte[]Deprecated.because this is evil!toString()Converts the buffer's contents into a string, translating bytes into characters according to the platform's default character encoding.voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwrite(InputStream in) Copies all the bytes from this input into this buffer.voidWrites a string as ASCII string.voidwriteTo(OutputStream out) Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
Constructor Details
-
ByteOutputStream
public ByteOutputStream() -
ByteOutputStream
public ByteOutputStream(int size)
-
-
Method Details
-
write
Copies all the bytes from this input into this buffer.- Parameters:
in- input stream.- Throws:
IOException- in case of an I/O error.
-
write
public void write(int b) - Specified by:
writein classOutputStream
-
write
public void write(byte[] b, int off, int len) - Overrides:
writein classOutputStream
-
write
public void write(byte[] b) - Overrides:
writein classOutputStream
-
writeAsAscii
Writes a string as ASCII string.- Parameters:
s- string to write.
-
writeTo
- Throws:
IOException
-
reset
public void reset() -
toByteArray
Deprecated.because this is evil!Evil buffer reallocation method. Don't use it unless you absolutely have to.- Returns:
- byte array
-
size
public int size() -
newInputStream
-
toString
Converts the buffer's contents into a string, translating bytes into characters according to the platform's default character encoding. -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-
getBytes
public byte[] getBytes() -
getCount
public int getCount()
-