Methods
write(int)Declaration:
public void write(int b)
Description:
Writes the specified byte to this byte array output stream.
Overrides: write in class OutputStream
ByteArrayOutputStream
write(byte[], int, int)
10
Parameters:
b - the byte to be written.
write(byte[], int, int)
Declaration:
public void write(byte[] b, int off, int len)
Description:
Writes len bytes from the specified byte array starting at offset off to this byte array output stream.
Overrides: write in class OutputStream
Parameters:
b - the data.
off - the start offset in the data.
len - the number of bytes to write.
reset()
Declaration:
public void reset()
Description:
Resets the count field of this byte array output stream to zero, so that all currently accumulated output in
the output stream is discarded. The output stream can be used again, reusing the already allocated buffer
space.
See Also: ByteArrayInputStream.count
toByteArray()
Declaration:
public byte[] toByteArray()
Description:
Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents
of the buffer have been copied into it.
Returns: the current contents of this output stream, as a byte array.
See Also: size()
size()
Declaration:
public int size()
Description:
Returns the current size of the buffer.
Returns: the value of the count field, which is the number of valid bytes in this output stream.
See Also: count
toString()
Declaration:
public java.lang.String toString()
Description:
Converts the buffer’s contents into a string, translating bytes into characters according to the platform’s
default character encoding.
Overrides: toString in class Object
Returns: String translated from the buffer’s contents.
Since: JDK1.1
close()
Declaration:
public void close()
throws IOException
Description:
Closes this output stream and releases any system resources associated with this stream. A closed stream
cannot perform output operations and cannot be reopened.
Overrides: close in class OutputStream
Throws:
IOException - if an I/O error occurs.
No comments:
Post a Comment