/** * @deprecated (4.3) use * {@link SessionOutputBufferImpl#SessionOutputBufferImpl(int, int, CharsetEncoder, * ByteBufferAllocator)} */ @Deprecated public SessionOutputBufferImpl( final int buffersize, final int lineBuffersize, final ByteBufferAllocator allocator, final HttpParams params) { super(buffersize, allocator); this.lineBuffersize = Args.positive(lineBuffersize, "Line buffer size"); final String charsetName = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET); final Charset charset = CharsetUtils.lookup(charsetName); if (charset != null) { this.charencoder = charset.newEncoder(); final CodingErrorAction a1 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION); this.charencoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT); final CodingErrorAction a2 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION); this.charencoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT); } else { this.charencoder = null; } }
/** * @deprecated (4.3) use * {@link SessionInputBufferImpl#SessionInputBufferImpl(int, int, CharsetDecoder, * ByteBufferAllocator)} */ @Deprecated public SessionInputBufferImpl( final int buffersize, final int lineBuffersize, final ByteBufferAllocator allocator, final HttpParams params) { super(buffersize, allocator); this.lineBuffersize = Args.positive(lineBuffersize, "Line buffer size"); final String charsetName = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET); final Charset charset = CharsetUtils.lookup(charsetName); if (charset != null) { this.chardecoder = charset.newDecoder(); final CodingErrorAction a1 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION); this.chardecoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT); final CodingErrorAction a2 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION); this.chardecoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT); } else { this.chardecoder = null; } this.constraints = MessageConstraints.DEFAULT; }
/** * @deprecated (4.3) use * {@link SessionOutputBufferImpl#SessionOutputBufferImpl(int, int, CharsetEncoder, * ByteBufferAllocator)} */ @Deprecated public SessionOutputBufferImpl( final int buffersize, final int lineBuffersize, final ByteBufferAllocator allocator, final HttpParams params) { super(buffersize, allocator); this.lineBuffersize = Args.positive(lineBuffersize, "Line buffer size"); final String charsetName = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET); final Charset charset = CharsetUtils.lookup(charsetName); if (charset != null) { this.charencoder = charset.newEncoder(); final CodingErrorAction a1 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION); this.charencoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT); final CodingErrorAction a2 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION); this.charencoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT); } else { this.charencoder = null; } }
/** * @deprecated (4.3) use * {@link SessionInputBufferImpl#SessionInputBufferImpl(int, int, CharsetDecoder, * ByteBufferAllocator)} */ @Deprecated public SessionInputBufferImpl( final int buffersize, final int lineBuffersize, final ByteBufferAllocator allocator, final HttpParams params) { super(buffersize, allocator); this.lineBuffersize = Args.positive(lineBuffersize, "Line buffer size"); final String charsetName = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET); final Charset charset = CharsetUtils.lookup(charsetName); if (charset != null) { this.chardecoder = charset.newDecoder(); final CodingErrorAction a1 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION); this.chardecoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT); final CodingErrorAction a2 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION); this.chardecoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT); } else { this.chardecoder = null; } this.constraints = MessageConstraints.DEFAULT; }
Charset charset = CharsetUtils.lookup( (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET)); if (charset != null) {
Charset charset = CharsetUtils.lookup( (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET)); if (charset != null) {