com.liferay.portal.kernel.io
Class RestrictedByteArrayCacheOutputStream
java.lang.Object
java.io.OutputStream
com.liferay.portal.kernel.io.RestrictedByteArrayCacheOutputStream
- All Implemented Interfaces:
- Closeable, Flushable, AutoCloseable
public class RestrictedByteArrayCacheOutputStream
- extends OutputStream
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cache
protected byte[] cache
cacheCapacity
protected int cacheCapacity
flushPreAction
protected RestrictedByteArrayCacheOutputStream.FlushPreAction flushPreAction
index
protected int index
outputStream
protected OutputStream outputStream
overflowed
protected boolean overflowed
RestrictedByteArrayCacheOutputStream
public RestrictedByteArrayCacheOutputStream(OutputStream outputStream,
int cacheCapacity,
RestrictedByteArrayCacheOutputStream.FlushPreAction flushPreAction)
RestrictedByteArrayCacheOutputStream
public RestrictedByteArrayCacheOutputStream(OutputStream outputStream,
int initialCacheSize,
int cacheCapacity,
RestrictedByteArrayCacheOutputStream.FlushPreAction flushPreAction)
flush
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class OutputStream
- Throws:
IOException
getCacheCapacity
public int getCacheCapacity()
isOverflowed
public boolean isOverflowed()
reset
public void reset()
size
public int size()
toByteArray
public byte[] toByteArray()
unsafeGetByteArray
public byte[] unsafeGetByteArray()
unsafeGetByteBuffer
public ByteBuffer unsafeGetByteBuffer()
write
public void write(byte[] bytes)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
write
public void write(byte[] bytes,
int offset,
int length)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
write
public void write(int b)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
ensureCacheSize
protected void ensureCacheSize(int newIndex)