code: public void listStream(PRStream stream, PdfReaderInstance reader)
      {
          try {
              listDict(stream);
              out.println("startstream");
              byte[] b = PdfReader.getStreamBytes(stream);
  //                  byte buf[] = new byte[Math.min(stream.getLength(), 4096)];
  //                  int r = 0;
  //                  stream.openStream(reader);
  //                  for (;;) {
  //                      r = stream.readStream(buf, 0, buf.length);
  //                      if (r == 0) break;
  //                      out.write(buf, 0, r);
  //                  }
  //                  stream.closeStream();
              int len = b.length - 1;
              for (int k = 0; k < len; ++k) {
                  if (b[k] == '\r' && b[k + 1] != '\n')
                      b[k] = (byte)'\n';
              }
              out.println(new String(b));
              out.println("endstream");
          } catch (IOException e) {
              System.err.println("I/O exception: " + e);
  //          } catch (java.util.zip.DataFormatException e) {
  //              System.err.println("Data Format Exception: " + e);
          }
      }
docs: Visualizes a Stream.
  @param stream
  @param reader