@Override
 public String getText() throws IOException {
   if (canEncode()) {
     return BioUtils.toString(getStream(), getCharacterSet());
   } else {
     return getWrappedRepresentation().getText();
   }
 }
  /**
   * @see MessageBodyReader#readFrom(Class, Type, Annotation[], MediaType, MultivaluedMap,
   *     InputStream)
   */
  public Boolean readFrom(
      Class<Boolean> type,
      Type genericType,
      Annotation[] annotations,
      MediaType mediaType,
      MultivaluedMap<String, String> httpHeaders,
      InputStream entityStream)
      throws IOException {
    String str = BioUtils.toString(entityStream);

    if (str.length() == 0) {
      return null;
    }

    return new Boolean(str);
  }