Class RestrictedByteArrayCacheOutputStream
Object
OutputStream
com.liferay.portal.kernel.internal.servlet.RestrictedByteArrayCacheOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Author:
- Shuyang Zhou
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]
protected int
protected int
protected OutputStream
protected boolean
-
Constructor Summary
ConstructorsConstructorDescriptionRestrictedByteArrayCacheOutputStream
(OutputStream outputStream, int initialCacheSize, int cacheCapacity, RestrictedByteArrayCacheOutputStream.FlushPreAction flushPreAction) RestrictedByteArrayCacheOutputStream
(OutputStream outputStream, int cacheCapacity, RestrictedByteArrayCacheOutputStream.FlushPreAction flushPreAction) -
Method Summary
Methods inherited from class java.io.OutputStream
close, nullOutputStream
-
Field Details
-
cache
protected byte[] cache -
cacheCapacity
protected int cacheCapacity -
flushPreAction
-
index
protected int index -
outputStream
-
overflowed
protected boolean overflowed
-
-
Constructor Details
-
RestrictedByteArrayCacheOutputStream
public RestrictedByteArrayCacheOutputStream(OutputStream outputStream, int cacheCapacity, RestrictedByteArrayCacheOutputStream.FlushPreAction flushPreAction) -
RestrictedByteArrayCacheOutputStream
public RestrictedByteArrayCacheOutputStream(OutputStream outputStream, int initialCacheSize, int cacheCapacity, RestrictedByteArrayCacheOutputStream.FlushPreAction flushPreAction)
-
-
Method Details
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- 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
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
ensureCacheSize
protected void ensureCacheSize(int newIndex)
-