public class SafeTokenReader
extends java.io.Reader
If a graphql system does not have some max HTTP input limit, then this will help protect the system. This is a limit of last resort. Ideally the http input should be limited, but if its not, we have this.
Constructor and Description |
---|
SafeTokenReader(java.io.Reader delegate,
int maxCharacters,
java.util.function.Consumer<java.lang.Integer> whenMaxCharactersExceeded) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(char[] buff) |
int |
read(char[] buff,
int off,
int len) |
int |
read(@NotNull java.nio.CharBuffer target) |
boolean |
ready() |
void |
reset() |
long |
skip(long n) |
public SafeTokenReader(java.io.Reader delegate, int maxCharacters, java.util.function.Consumer<java.lang.Integer> whenMaxCharactersExceeded)
public int read(char[] buff, int off, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read(@NotNull @NotNull java.nio.CharBuffer target) throws java.io.IOException
read
in interface java.lang.Readable
read
in class java.io.Reader
java.io.IOException
public int read(char[] buff) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Reader
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.Reader
java.io.IOException
public boolean ready() throws java.io.IOException
ready
in class java.io.Reader
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.Reader
public void mark(int readAheadLimit) throws java.io.IOException
mark
in class java.io.Reader
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.Reader
java.io.IOException