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 OutputStream
bytes
- IOException
public void write(byte[] bytes, int start, int length) throws IOException
write
in class OutputStream
bytes
- start
- length
- IOException
public void write(int b) throws IOException
write
in class OutputStream
b
- IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public long size()
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
protected void increaseCapacity(int count) throws IOException
count
- IOException
public void discardBuffer()
protected InputStream makeInputStream() throws IOException, FileNotFoundException
IOException
FileNotFoundException
protected void switchToBackingStore() throws IOException
IOException
public String getBackingStoreFileName() throws IOException
IOException
protected void discardBackingStore()
protected InputStream createBackingStoreInputStream() throws FileNotFoundException
FileNotFoundException
public byte[] toByteArray() throws IOException
IOException
public void writeTo(OutputStream os) throws IOException
os
- IOException
Copyright © The Apache Software Foundation. All Rights Reserved.