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.OutputStream
Class ByteArray
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.File
bs_handle
protected java.io.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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Method closeprotected java.io.InputStream
createBackingStoreInputStream()
Method createBackingStoreInputStreamprotected void
discardBackingStore()
Method discardBackingStorevoid
discardBuffer()
Method discardBufferprotected void
finalize()
Method finalizevoid
flush()
Method flushjava.lang.String
getBackingStoreFileName()
Method getBackingStoreFileNamestatic double
getDEFAULT_CACHE_INCREMENT()
static int
getDEFAULT_RESIDENT_SIZE()
protected void
increaseCapacity(int count)
Method increaseCapacitystatic boolean
isDEFAULT_ENABLE_BACKING_STORE()
boolean
isEnableBackingStore()
protected java.io.InputStream
makeInputStream()
Method makeInputStreamstatic 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 sizeprotected void
switchToBackingStore()
Method switchToBackingStorebyte[]
toByteArray()
Method toByteArrayvoid
write(byte[] bytes)
Method writevoid
write(byte[] bytes, int start, int length)
Method writevoid
write(int b)
Method writevoid
writeTo(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.IOException
Method write- Overrides:
write
in classjava.io.OutputStream
- Parameters:
bytes
-- Throws:
java.io.IOException
-
write
public void write(byte[] bytes, int start, int length) throws java.io.IOException
Method write- Overrides:
write
in classjava.io.OutputStream
- Parameters:
bytes
-start
-length
-- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException
Method write- Specified by:
write
in classjava.io.OutputStream
- Parameters:
b
-- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Method close- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
size
public long size()
Method size- Returns:
-
flush
public void flush() throws java.io.IOException
Method flush- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
increaseCapacity
protected void increaseCapacity(int count) throws java.io.IOException
Method 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.FileNotFoundException
Method makeInputStream- Returns:
- Throws:
java.io.IOException
java.io.FileNotFoundException
-
finalize
protected void finalize()
Method finalize- Overrides:
finalize
in classjava.lang.Object
-
switchToBackingStore
protected void switchToBackingStore() throws java.io.IOException
Method switchToBackingStore- Throws:
java.io.IOException
-
getBackingStoreFileName
public java.lang.String getBackingStoreFileName() throws java.io.IOException
Method getBackingStoreFileName- Throws:
java.io.IOException
-
discardBackingStore
protected void discardBackingStore()
Method discardBackingStore
-
createBackingStoreInputStream
protected java.io.InputStream createBackingStoreInputStream() throws java.io.FileNotFoundException
Method createBackingStoreInputStream- Returns:
- Throws:
java.io.FileNotFoundException
-
toByteArray
public byte[] toByteArray() throws java.io.IOException
Method toByteArray- Returns:
- Throws:
java.io.IOException
-
writeTo
public void writeTo(java.io.OutputStream os) throws java.io.IOException
Method writeTo- Parameters:
os
-- Throws:
java.io.IOException
-
-