to top
Android APIs
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

Class Overview

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.
[Expand]
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

Public Constructors

public AssetFileDescriptor.AutoCloseOutputStream (AssetFileDescriptor fd)

Added in API level 3

Throws
IOException

Public Methods

public void write (byte[] buffer, int offset, int count)

Added in API level 3

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

Parameters
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.
Throws
IOException

public void write (byte[] buffer)

Added in API level 3

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

Throws
IOException

public void write (int oneByte)

Added in API level 3

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

Parameters
oneByte the byte to be written.
Throws
IOException