public String consumeLiteral(Charset charset) throws DecodingException {
  if (charset == null) {
    return consumeLiteral(US_ASCII);
  }
 else {
    FastByteArrayOutputStream out=new FastByteArrayOutputStream();
    InputStream in=null;
    try {
      in=consumeLiteral(false);
      byte[] buf=new byte[0xFFFF];
      for (int len; (len=in.read(buf)) != -1; )       out.write(buf,0,len);
      final byte[] bytes=out.toByteArray();
      final ByteBuffer buffer=ByteBuffer.wrap(bytes);
      return decode(charset,buffer);
    }
 catch (    IOException e) {
      throw new DecodingException(HumanReadableText.BAD_IO_ENCODING,"Bad character encoding",e);
    }
 finally {
      if (in != null) {
        try {
          in.close();
        }
 catch (        IOException e) {
        }
      }
      try {
        out.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

public String consumeLiteral ( Charset charset ) throws DecodingException { if ( charset == null ) { return consumeLiteral ( US_ASCII ) ; } else { FastByteArrayOutputStream out = new FastByteArrayOutputStream ( ) ; InputStream in = null ; try { in = consumeLiteral ( false ) ; byte [ ] buf = new byte [ 0xFFFF ] ; for ( int len ; ( len = in . read ( buf ) ) != - 1 ; ) out . write ( buf , 0 , len ) ; final byte [ ] bytes = out . toByteArray ( ) ; final ByteBuffer buffer = ByteBuffer . wrap ( bytes ) ; return decode ( charset , buffer ) ; } catch ( IOException e ) { throw new DecodingException ( HumanReadableText . BAD_IO_ENCODING , "Bad character encoding" , e ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( IOException e ) { } } try { out . close ( ) ; } catch ( IOException e ) { } } } }
reads an argument of type " literal " from the request , in the format : " { " charcount " } " crlf * char8 note before calling , the request should be positioned so that nextchar is ' { ' . leading whitespace is not skipped in this method .
