private void writeEncoded(char[] ca,int offset, int length) throws IOException { if (_bout==null) { _bout = new ByteArrayOutputStream2(2*length); _writer = new OutputStreamWriter(_bout,StringUtil.__ISO_8859_1); } else _bout.reset(); _writer.write(ca,offset,length); _writer.flush(); ensureSpareCapacity(_bout.getCount()); System.arraycopy(_bout.getBuf(),0,_buf,_size,_bout.getCount()); _size+=_bout.getCount(); }
ByteArrayOutputStream2 output = new ByteArrayOutputStream2();
public void setCharacterEncoding(String encoding) { if (encoding == null || StringUtil.__ISO_8859_1.equalsIgnoreCase(encoding)) { _writeMode = WRITE_ISO1; } else if (StringUtil.__UTF8.equalsIgnoreCase(encoding)) { _writeMode = WRITE_UTF8; } else { _writeMode = WRITE_CONV; if (_out._characterEncoding == null || !_out._characterEncoding.equalsIgnoreCase(encoding)) _out._converter = null; // Set lazily in getConverter() } _out._characterEncoding = encoding; if (_out._bytes==null) _out._bytes = new ByteArrayOutputStream2(MAX_OUTPUT_CHARS); }
public void content(Buffer ref) throws IOException { if (_parsedContent==null) _parsedContent=new ByteArrayOutputStream2(); _parsedContent.write(ref.asArray()); } }