Methods Summary |
---|
public void | cleanup()
if ( mOutputStream != null )
{
mOutputStream.close();
}
getFile().delete();
|
private static java.io.File | createTempFile(java.lang.Object id, java.lang.String name, long totalSize)
final String tempName = (name != null) ? name : id + "_" + totalSize;
File actual = new File( tempName );
if ( actual.exists() )
{
actual = File.createTempFile( tempName, null );
}
return( actual );
|
private java.io.FileOutputStream | getOutputStream()
return( mOutputStream );
|
public long | getTotalSize()
return( mTotalSize );
|
public boolean | isDone()
return( mWrittenSoFar == mTotalSize );
|
public boolean | write(byte[] bytes)
if ( isDone() || mWrittenSoFar + bytes.length > mTotalSize )
{
throw new IllegalArgumentException( "too many bytes" );
}
getOutputStream().write( bytes );
mWrittenSoFar += bytes.length;
if ( isDone() )
{
mOutputStream.close();
mOutputStream = null;
}
accessed();
return( isDone() );
|