public class ByteArray extends OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected File |
bs_handle |
protected OutputStream |
bs_stream |
protected ByteArrayOutputStream |
cache |
protected long |
count |
protected static double |
DEFAULT_CACHE_INCREMENT |
protected static boolean |
DEFAULT_ENABLE_BACKING_STORE |
protected static int |
DEFAULT_RESIDENT_SIZE |
protected boolean |
enableBackingStore |
protected int |
max_size |
protected static int |
WORKING_BUFFER_SIZE |
| Constructor and Description |
|---|
ByteArray()
Constructor ByteArray
|
ByteArray(int max_resident_size)
Constructor ByteArray
|
ByteArray(int probable_size,
int max_resident_size)
Constructor ByteArray
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Method close
|
protected InputStream |
createBackingStoreInputStream()
Method createBackingStoreInputStream
|
protected void |
discardBackingStore()
Method discardBackingStore
|
void |
discardBuffer()
Method discardBuffer
|
protected void |
finalize()
Method finalize
|
void |
flush()
Method flush
|
String |
getBackingStoreFileName()
Method getBackingStoreFileName
|
static double |
getDEFAULT_CACHE_INCREMENT() |
static int |
getDEFAULT_RESIDENT_SIZE() |
protected void |
increaseCapacity(int count)
Method increaseCapacity
|
static boolean |
isDEFAULT_ENABLE_BACKING_STORE() |
boolean |
isEnableBackingStore() |
protected InputStream |
makeInputStream()
Method makeInputStream
|
static void |
setDEFAULT_CACHE_INCREMENT(double DEFAULT_CACHE_INCREMENT) |
static void |
setDEFAULT_ENABLE_BACKING_STORE(boolean DEFAULT_ENABLE_BACKING_STORE) |
static void |
setDEFAULT_RESIDENT_SIZE(int DEFAULT_RESIDENT_SIZE) |
void |
setEnableBackingStore(boolean enableBackingStore) |
long |
size()
Method size
|
protected void |
switchToBackingStore()
Method switchToBackingStore
|
byte[] |
toByteArray()
Method toByteArray
|
void |
write(byte[] bytes)
Method write
|
void |
write(byte[] bytes,
int start,
int length)
Method write
|
void |
write(int b)
Method write
|
void |
writeTo(OutputStream os)
Method writeTo
|
protected static double DEFAULT_CACHE_INCREMENT
protected static int DEFAULT_RESIDENT_SIZE
protected static boolean DEFAULT_ENABLE_BACKING_STORE
protected static int WORKING_BUFFER_SIZE
protected ByteArrayOutputStream cache
protected int max_size
protected File bs_handle
protected OutputStream bs_stream
protected long count
protected boolean enableBackingStore
public ByteArray()
public ByteArray(int max_resident_size)
max_resident_size - public ByteArray(int probable_size,
int max_resident_size)
probable_size - max_resident_size - public boolean isEnableBackingStore()
public void setEnableBackingStore(boolean enableBackingStore)
public static boolean isDEFAULT_ENABLE_BACKING_STORE()
public static void setDEFAULT_ENABLE_BACKING_STORE(boolean DEFAULT_ENABLE_BACKING_STORE)
public static int getDEFAULT_RESIDENT_SIZE()
public static void setDEFAULT_RESIDENT_SIZE(int DEFAULT_RESIDENT_SIZE)
public static double getDEFAULT_CACHE_INCREMENT()
public static void setDEFAULT_CACHE_INCREMENT(double DEFAULT_CACHE_INCREMENT)
public void write(byte[] bytes)
throws IOException
write in class OutputStreambytes - IOExceptionpublic void write(byte[] bytes,
int start,
int length)
throws IOException
write in class OutputStreambytes - start - length - IOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamb - IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic long size()
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionprotected void increaseCapacity(int count)
throws IOException
count - IOExceptionpublic void discardBuffer()
protected InputStream makeInputStream() throws IOException, FileNotFoundException
IOExceptionFileNotFoundExceptionprotected void switchToBackingStore()
throws IOException
IOExceptionpublic String getBackingStoreFileName() throws IOException
IOExceptionprotected void discardBackingStore()
protected InputStream createBackingStoreInputStream() throws FileNotFoundException
FileNotFoundExceptionpublic byte[] toByteArray()
throws IOException
IOExceptionpublic void writeTo(OutputStream os) throws IOException
os - IOExceptionCopyright © The Apache Software Foundation. All Rights Reserved.