private static ByteArrayOutputStream sizeLine(final InputStream stream) throws IOException {
  State state=State.NORMAL;
  final ByteArrayOutputStream result=new ByteArrayOutputStream();
  while (state != State.END) {
    state=next(stream,state,result);
  }
  return result;
}

private static ByteArrayOutputStream sizeLine ( final InputStream stream ) throws IOException { State state = State . NORMAL ; final ByteArrayOutputStream result = new ByteArrayOutputStream ( ) ; while ( state != State . END ) { state = next ( stream , state , result ) ; } return result ; }
extract line with chunk size from stream .
