Skip to content

Most visited

Recently visited

navigation
Added in API level 3

AssetFileDescriptor.AutoCloseOutputStream

public static class AssetFileDescriptor.AutoCloseOutputStream
extends ParcelFileDescriptor.AutoCloseOutputStream

java.lang.Object
   ↳ java.io.OutputStream
     ↳ java.io.FileOutputStream
       ↳ android.os.ParcelFileDescriptor.AutoCloseOutputStream
         ↳ android.content.res.AssetFileDescriptor.AutoCloseOutputStream


An OutputStream you can create on a ParcelFileDescriptor, which will take care of calling ParcelFileDescritor.close() for you when the stream is closed.

Summary

Public constructors

AssetFileDescriptor.AutoCloseOutputStream(AssetFileDescriptor fd)

Public methods

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(byte[] buffer)

Equivalent to write(buffer, 0, buffer.length).

void write(int oneByte)

Writes a single byte to this stream.

Inherited methods

From class android.os.ParcelFileDescriptor.AutoCloseOutputStream
From class java.io.FileOutputStream
From class java.io.OutputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable
From interface java.lang.AutoCloseable

Public constructors

AssetFileDescriptor.AutoCloseOutputStream

Added in API level 3
AssetFileDescriptor.AutoCloseOutputStream (AssetFileDescriptor fd)

Parameters
fd AssetFileDescriptor
Throws
IOException

Public methods

write

Added in API level 3
void write (byte[] buffer, 
                int offset, 
                int count)

Writes count bytes from the byte array buffer starting at position offset to this stream.

Parameters
buffer byte: the buffer to be written.
offset int: the start position in buffer from where to get bytes.
count int: the number of bytes from buffer to write to this stream.
Throws
IOException

write

Added in API level 3
void write (byte[] buffer)

Equivalent to write(buffer, 0, buffer.length).

Parameters
buffer byte
Throws
IOException

write

Added in API level 3
void write (int oneByte)

Writes a single byte to this stream. Only the least significant byte of the integer oneByte is written to the stream.

Parameters
oneByte int: the byte to be written.
Throws
IOException
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.