Package io.grpc.internal
Class MessageDeframer.SizeEnforcingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
io.grpc.internal.MessageDeframer.SizeEnforcingInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
MessageDeframer
An
InputStream
that enforces the maxMessageSize
limit for compressed frames.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private long
private long
private final int
private final StatsTraceContext
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsConstructorDescriptionSizeEnforcingInputStream
(InputStream in, int maxMessageSize, StatsTraceContext statsTraceCtx) -
Method Summary
Methods inherited from class java.io.FilterInputStream
available, close, markSupported, read
-
Field Details
-
maxMessageSize
private final int maxMessageSize -
statsTraceCtx
-
maxCount
private long maxCount -
count
private long count -
mark
private long mark
-
-
Constructor Details
-
SizeEnforcingInputStream
SizeEnforcingInputStream(InputStream in, int maxMessageSize, StatsTraceContext statsTraceCtx)
-
-
Method Details
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classFilterInputStream
-
reset
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
reportCount
private void reportCount() -
verifySize
private void verifySize()
-