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 intprotected intprotected OutputStreamprotected 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:
flushin interfaceFlushable- Overrides:
flushin 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:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
ensureCacheSize
protected void ensureCacheSize(int newIndex)
-