Package org.thymeleaf.engine
Class ThrottledTemplateWriterOutputStreamAdapter
java.lang.Object
java.io.OutputStream
org.thymeleaf.engine.ThrottledTemplateWriterOutputStreamAdapter
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,ThrottledTemplateWriter.IThrottledTemplateWriterAdapter
final class ThrottledTemplateWriterOutputStreamAdapter
extends OutputStream
implements ThrottledTemplateWriter.IThrottledTemplateWriterAdapter
- Since:
- 3.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TemplateFlowControllerprivate intprivate intprivate OutputStreamprivate byte[]private intprivate final intprivate intprivate final Stringprivate booleanprivate int -
Constructor Summary
ConstructorsConstructorDescriptionThrottledTemplateWriterOutputStreamAdapter(String templateName, TemplateFlowController flowController, int overflowIncrementInBytes) -
Method Summary
Modifier and TypeMethodDescriptionvoidallow(int limit) voidclose()private voidensureOverflowCapacity(int len) voidflush()intintintbooleanbooleanprivate voidoverflow(byte[] bytes, int off, int len) private voidoverflow(int c) (package private) voidvoidwrite(byte[] bytes) voidwrite(byte[] bytes, int off, int len) voidwrite(int b)
-
Field Details
-
templateName
-
flowController
-
overflowIncrementInBytes
private final int overflowIncrementInBytes -
os
-
overflow
private byte[] overflow -
overflowSize
private int overflowSize -
maxOverflowSize
private int maxOverflowSize -
overflowGrowCount
private int overflowGrowCount -
unlimited
private boolean unlimited -
limit
private int limit -
writtenCount
private int writtenCount
-
-
Constructor Details
-
ThrottledTemplateWriterOutputStreamAdapter
ThrottledTemplateWriterOutputStreamAdapter(String templateName, TemplateFlowController flowController, int overflowIncrementInBytes)
-
-
Method Details
-
setOutputStream
-
isOverflown
public boolean isOverflown()- Specified by:
isOverflownin interfaceThrottledTemplateWriter.IThrottledTemplateWriterAdapter
-
isStopped
public boolean isStopped()- Specified by:
isStoppedin interfaceThrottledTemplateWriter.IThrottledTemplateWriterAdapter
-
getWrittenCount
public int getWrittenCount()- Specified by:
getWrittenCountin interfaceThrottledTemplateWriter.IThrottledTemplateWriterAdapter
-
getMaxOverflowSize
public int getMaxOverflowSize()- Specified by:
getMaxOverflowSizein interfaceThrottledTemplateWriter.IThrottledTemplateWriterAdapter
-
getOverflowGrowCount
public int getOverflowGrowCount()- Specified by:
getOverflowGrowCountin interfaceThrottledTemplateWriter.IThrottledTemplateWriterAdapter
-
allow
public void allow(int limit) - Specified by:
allowin interfaceThrottledTemplateWriter.IThrottledTemplateWriterAdapter
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
overflow
private void overflow(int c) -
overflow
private void overflow(byte[] bytes, int off, int len) -
ensureOverflowCapacity
private void ensureOverflowCapacity(int len) -
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-