public static class AssetFileDescriptor.AutoCloseOutputStream extends ParcelFileDescriptor.AutoCloseOutputStream
ParcelFileDescritor.close()
for you when the stream is closed.Constructor and Description |
---|
AssetFileDescriptor.AutoCloseOutputStream(AssetFileDescriptor fd) |
Modifier and Type | Method and Description |
---|---|
void |
write(byte[] buffer)
Equivalent to
write(buffer, 0, buffer.length) . |
void |
write(byte[] buffer,
int offset,
int count)
Writes
count bytes from the byte array buffer starting at
position offset to this stream. |
void |
write(int oneByte)
Writes a single byte to this stream.
|
close
finalize, getChannel, getFD
flush
public AssetFileDescriptor.AutoCloseOutputStream(AssetFileDescriptor fd) throws IOException
IOException
public void write(byte[] buffer, int offset, int count) throws IOException
OutputStream
count
bytes from the byte array buffer
starting at
position offset
to this stream.write
in class FileOutputStream
buffer
- the buffer to be written.offset
- the start position in buffer
from where to get bytes.count
- the number of bytes from buffer
to write to this
stream.IOException
- if an error occurs while writing to this stream.public void write(byte[] buffer) throws IOException
OutputStream
write(buffer, 0, buffer.length)
.write
in class OutputStream
IOException
public void write(int oneByte) throws IOException
OutputStream
oneByte
is written to the stream.write
in class FileOutputStream
oneByte
- the byte to be written.IOException
- if an error occurs while writing to this stream.