예제 #1
0
 /**
  * @param content
  * @param codings
  * @return
  * @throws MessageFormatException
  */
 public static InputStream encode(MessageHeader header, InputStream content)
     throws MessageFormatException {
   String codings = header.getHeader("Content-Encoding");
   content = encode(codings, content);
   codings = header.getHeader("Transfer-Encoding");
   content = encode(codings, content);
   return content;
 }
예제 #2
0
 public static InputStream decode(MessageHeader message, InputStream content)
     throws IOException, MessageFormatException {
   if (content == null) return content;
   String codings = message.getHeader(TRANSFER_ENCODING);
   content = decode(codings, content);
   codings = message.getHeader(CONTENT_ENCODING);
   content = decode(codings, content);
   return content;
 }