Code example for CharsetEncoder

Methods: encode

0
	} 
 
	public void write(char[] charArray, int offset, int length)
		throws IOException { 
 
		ByteBuffer byteBuffer = _charsetEncoder.encode(
			CharBuffer.wrap(charArray, offset, length));
 
		_outputStream.write(byteBuffer.array(), 0, byteBuffer.limit());
	} 
 
	public void write(int c) throws IOException {
		ByteBuffer byteBuffer = _charsetEncoder.encode(
			CharBuffer.wrap(new char[] {(char)c}));
 
		_outputStream.write(byteBuffer.array(), 0, byteBuffer.limit());
	} 
 
	public void write(String string, int offset, int length)
		throws IOException {