code: public void parse (Reader reader) {
  		try {
  			char[] data = new char[1024];
  			int offset = 0;
  			while (true) {
  				int length = reader.read(data, offset, data.length - offset);
  				if (length == -1) break;
  				if (length == 0) {
  					char[] newData = new char[data.length * 2];
  					System.arraycopy(data, 0, newData, 0, data.length);
  					data = newData;
  				} else
  					offset += length;
  			}
  			parse(data, 0, offset);
  		} catch (IOException ex) {
  			throw new SerializationException(ex);
  		} finally {
  			StreamUtils.closeQuietly(reader);
  		}
  	}
docs: Parses the given reader.
  @param reader the reader
  @throws SerializationException if the reader cannot be successfully parsed.