/** * Constructs a new InputStreamReader on the InputStream {@code in} and * CharsetDecoder {@code dec}. * * @param in * the source InputStream from which to read characters. * @param dec * the CharsetDecoder used by the character conversion. */ public InputStreamReader(InputStream in, CharsetDecoder dec) { super(in); dec.averageCharsPerByte(); this.in = in; decoder = dec; bytes.limit(0); }
/** * Constructs a new InputStreamReader on the InputStream {@code in} and * CharsetDecoder {@code dec}. * * @param in * the source InputStream from which to read characters. * @param dec * the CharsetDecoder used by the character conversion. */ public InputStreamReader(InputStream in, CharsetDecoder dec) { super(in); dec.averageCharsPerByte(); this.in = in; decoder = dec; bytes.limit(0); }
decoder.reset(); int expectedLength = (int) (remaining() * decoder.averageCharsPerByte()) + 1; CharBuffer out = CharBuffer.allocate(expectedLength); for (;;) {
decoder.reset(); int expectedLength = (int) (remaining() * decoder.averageCharsPerByte()) + 1; CharBuffer out = CharBuffer.allocate(expectedLength); for (;;) {
int expectedLength = (int) (remaining() * decoder.averageCharsPerByte()) + 1; CharBuffer out = CharBuffer.allocate(expectedLength); for (;;) {
private CharBuffer allocate() { int expectedLength = (int) (buffer.remaining() * decoder.averageCharsPerByte()) + 1; return CharBuffer.allocate(expectedLength); }
private ProxyDecoder (final CharsetDecoder defaultDecoder) { super (ProxyCharset.this, defaultDecoder.averageCharsPerByte(), defaultDecoder.maxCharsPerByte()); this.currentDecoder = defaultDecoder; initialized = true; }
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
protected Decoder(CharsetDecoder baseDecoder) { super(AddBOMCharset.this, baseDecoder.averageCharsPerByte(), baseDecoder.maxCharsPerByte()); this.baseDecoder = baseDecoder; baseDecoder.onMalformedInput(CodingErrorAction.REPORT); baseDecoder.onUnmappableCharacter(CodingErrorAction.REPORT); }
/** * Call the superclass constructor with the Charset object and pass * along the chars/byte values from the decoder. */ Decoder(Charset cs, CharsetDecoder decoder) { super(cs, decoder.averageCharsPerByte(), decoder.maxCharsPerByte()); this.decoder = decoder; }
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
/** * Call the superclass constructor with the Charset object and pass * along the chars/byte values from the decoder. */ Decoder(Charset cs, CharsetDecoder decoder) { super(cs, decoder.averageCharsPerByte(), decoder.maxCharsPerByte()); this.decoder = decoder; }
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
/** * * @param requestNIOInputStream the {@link Request} {@link NIOInputStream} * from which binary content will be supplied */ protected void initialize(final NIOInputStream requestInputStream, final String encoding) { this.requestNIOInputStream = requestInputStream; this.encoding = encoding; this.averageCharsPerByte = getDecoder().averageCharsPerByte(); } // ----------------------------------------------------- Methods from Reader
/** * Constructor, call the superclass constructor with the * Charset object and pass alon the chars/byte values * from the delegate decoder. */ PicaDecoder(Charset cs, CharsetDecoder baseDecoder) { // base decoder only needed for size hints super(cs, baseDecoder.averageCharsPerByte(), baseDecoder.maxCharsPerByte()); }