java.lang.Object |
↳ |
java.io.OutputStream |
|
↳ |
com.evernote.client.conn.mobile.DiskBackedByteStore |
Class Overview
Implements an OutputStream that stores data to a temporary file on disk.
Used by TAndroidHttpClient to write Thrift messages to disk before
POSTing them to the Thrift server.
You should not need to interact with this class directly.
Summary
Public Constructors |
|
DiskBackedByteStore(File file, int maxMemory)
Constructor that sets the exact name of the file to use
if we have to swap data out to secondary store.
|
|
DiskBackedByteStore(File parentDir, String prefix, int maxMemory)
|
[Expand]
Inherited Methods |
From class
java.io.OutputStream
void
|
close()
|
void
|
flush()
|
void
|
write(byte[] arg0, int arg1, int arg2)
|
void
|
write(byte[] arg0)
|
abstract
void
|
write(int arg0)
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
java.io.Closeable
|
From interface
java.io.Flushable
|
Fields
protected
ByteArrayOutputStream
byteArray
protected
OutputStream
current
protected
Exception
exception
protected
FileInputStream
fileInputStream
protected
FileOutputStream
fileoutputStream
protected
int
maxMemory
The maximum amount of memory to use before writing to disk
Public Constructors
public
DiskBackedByteStore
(File file, int maxMemory)
Constructor that sets the exact name of the file to use
if we have to swap data out to secondary store.
Parameters
file |
The full pathname where we will swap data. |
maxMemory |
The size, in bytes, that we will buffer
until we swap.
|
public
DiskBackedByteStore
(File parentDir, String prefix, int maxMemory)
Public Methods
public
Exception
getException
()
public
InputStream
getInputStream
()
public
void
write
(byte[] buffer, int offset, int count)
public
void
write
(int oneByte)
Protected Methods
protected
File
makeTempFile
()
protected
void
swapToDisk
()
Throws
FileNotFoundException
| |
IOException
| |