Package org.apache.axis.utils
Class ByteArray
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.axis.utils.ByteArray
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class ByteArray extends java.io.OutputStreamClass ByteArray
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.Filebs_handleprotected java.io.OutputStreambs_streamprotected ByteArrayOutputStreamcacheprotected longcountprotected static doubleDEFAULT_CACHE_INCREMENTprotected static booleanDEFAULT_ENABLE_BACKING_STOREprotected static intDEFAULT_RESIDENT_SIZEprotected booleanenableBackingStoreprotected intmax_sizeprotected static intWORKING_BUFFER_SIZE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Method closeprotected java.io.InputStreamcreateBackingStoreInputStream()Method createBackingStoreInputStreamprotected voiddiscardBackingStore()Method discardBackingStorevoiddiscardBuffer()Method discardBufferprotected voidfinalize()Method finalizevoidflush()Method flushjava.lang.StringgetBackingStoreFileName()Method getBackingStoreFileNamestatic doublegetDEFAULT_CACHE_INCREMENT()static intgetDEFAULT_RESIDENT_SIZE()protected voidincreaseCapacity(int count)Method increaseCapacitystatic booleanisDEFAULT_ENABLE_BACKING_STORE()booleanisEnableBackingStore()protected java.io.InputStreammakeInputStream()Method makeInputStreamstatic voidsetDEFAULT_CACHE_INCREMENT(double DEFAULT_CACHE_INCREMENT)static voidsetDEFAULT_ENABLE_BACKING_STORE(boolean DEFAULT_ENABLE_BACKING_STORE)static voidsetDEFAULT_RESIDENT_SIZE(int DEFAULT_RESIDENT_SIZE)voidsetEnableBackingStore(boolean enableBackingStore)longsize()Method sizeprotected voidswitchToBackingStore()Method switchToBackingStorebyte[]toByteArray()Method toByteArrayvoidwrite(byte[] bytes)Method writevoidwrite(byte[] bytes, int start, int length)Method writevoidwrite(int b)Method writevoidwriteTo(java.io.OutputStream os)Method writeTo
-
-
-
Field Detail
-
DEFAULT_CACHE_INCREMENT
protected static double DEFAULT_CACHE_INCREMENT
-
DEFAULT_RESIDENT_SIZE
protected static int DEFAULT_RESIDENT_SIZE
-
DEFAULT_ENABLE_BACKING_STORE
protected static boolean DEFAULT_ENABLE_BACKING_STORE
-
WORKING_BUFFER_SIZE
protected static int WORKING_BUFFER_SIZE
-
cache
protected ByteArrayOutputStream cache
-
max_size
protected int max_size
-
bs_handle
protected java.io.File bs_handle
-
bs_stream
protected java.io.OutputStream bs_stream
-
count
protected long count
-
enableBackingStore
protected boolean enableBackingStore
-
-
Constructor Detail
-
ByteArray
public ByteArray()
Constructor ByteArray
-
ByteArray
public ByteArray(int max_resident_size)
Constructor ByteArray- Parameters:
max_resident_size-
-
ByteArray
public ByteArray(int probable_size, int max_resident_size)Constructor ByteArray- Parameters:
probable_size-max_resident_size-
-
-
Method Detail
-
isEnableBackingStore
public boolean isEnableBackingStore()
-
setEnableBackingStore
public void setEnableBackingStore(boolean enableBackingStore)
-
isDEFAULT_ENABLE_BACKING_STORE
public static boolean isDEFAULT_ENABLE_BACKING_STORE()
-
setDEFAULT_ENABLE_BACKING_STORE
public static void setDEFAULT_ENABLE_BACKING_STORE(boolean DEFAULT_ENABLE_BACKING_STORE)
-
getDEFAULT_RESIDENT_SIZE
public static int getDEFAULT_RESIDENT_SIZE()
-
setDEFAULT_RESIDENT_SIZE
public static void setDEFAULT_RESIDENT_SIZE(int DEFAULT_RESIDENT_SIZE)
-
getDEFAULT_CACHE_INCREMENT
public static double getDEFAULT_CACHE_INCREMENT()
-
setDEFAULT_CACHE_INCREMENT
public static void setDEFAULT_CACHE_INCREMENT(double DEFAULT_CACHE_INCREMENT)
-
write
public void write(byte[] bytes) throws java.io.IOExceptionMethod write- Overrides:
writein classjava.io.OutputStream- Parameters:
bytes-- Throws:
java.io.IOException
-
write
public void write(byte[] bytes, int start, int length) throws java.io.IOExceptionMethod write- Overrides:
writein classjava.io.OutputStream- Parameters:
bytes-start-length-- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOExceptionMethod write- Specified by:
writein classjava.io.OutputStream- Parameters:
b-- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionMethod close- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
size
public long size()
Method size- Returns:
-
flush
public void flush() throws java.io.IOExceptionMethod flush- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
increaseCapacity
protected void increaseCapacity(int count) throws java.io.IOExceptionMethod increaseCapacity- Parameters:
count-- Throws:
java.io.IOException
-
discardBuffer
public void discardBuffer()
Method discardBuffer
-
makeInputStream
protected java.io.InputStream makeInputStream() throws java.io.IOException, java.io.FileNotFoundExceptionMethod makeInputStream- Returns:
- Throws:
java.io.IOExceptionjava.io.FileNotFoundException
-
finalize
protected void finalize()
Method finalize- Overrides:
finalizein classjava.lang.Object
-
switchToBackingStore
protected void switchToBackingStore() throws java.io.IOExceptionMethod switchToBackingStore- Throws:
java.io.IOException
-
getBackingStoreFileName
public java.lang.String getBackingStoreFileName() throws java.io.IOExceptionMethod getBackingStoreFileName- Throws:
java.io.IOException
-
discardBackingStore
protected void discardBackingStore()
Method discardBackingStore
-
createBackingStoreInputStream
protected java.io.InputStream createBackingStoreInputStream() throws java.io.FileNotFoundExceptionMethod createBackingStoreInputStream- Returns:
- Throws:
java.io.FileNotFoundException
-
toByteArray
public byte[] toByteArray() throws java.io.IOExceptionMethod toByteArray- Returns:
- Throws:
java.io.IOException
-
writeTo
public void writeTo(java.io.OutputStream os) throws java.io.IOExceptionMethod writeTo- Parameters:
os-- Throws:
java.io.IOException
-
-