Package net.sf.jpluck.palm

Examples of net.sf.jpluck.palm.PdbOutputStream


            throw new IllegalStateException("No rows in table.");
        }*/
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        for (Iterator iterator = rowList.iterator(); iterator.hasNext();) {
            TableRow tableRow = (TableRow) iterator.next();
            tableRow.write(new PdbOutputStream(baos));
        }
        byte[] data = baos.toByteArray();
        out.writeShort(data.length);
        out.writeShort(getColumnCount());
        out.writeShort(rowList.size());
View Full Code Here


    this.body = body;
  }

  public Paragraph[] writeData(PdbOutputStream out) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PdbOutputStream pdb = new PdbOutputStream(baos);
    int offset = 8;
    if (to != null) {
      pdb.writeShort(offset);
      offset += to.length() + 1;
    } else {
      pdb.writeShort(0);
    }
    if (cc != null) {
      pdb.writeShort(offset);
      offset += cc.length() + 1;
    } else {
      pdb.writeShort(0);
    }
    if (subject != null) {
      pdb.writeShort(offset);
      offset += subject.length() + 1;
    } else {
      pdb.writeShort(0);
    }
    if (body != null) {
      pdb.writeShort(offset);
      offset += body.length() + 1;
    } else {
      pdb.writeShort(0);
    }
    if (to != null) {
      pdb.writeString(to);
      pdb.writeByte(0);
    }
    if (cc != null) {
      pdb.writeString(cc);
      pdb.writeByte(0);
    }
    if (subject != null) {
      pdb.writeString(subject);
      pdb.writeByte(0);
    }
    if (body != null) {
      pdb.writeString(body);
      pdb.writeByte(0);
    }

    byte[] data = baos.toByteArray();
    out.write(data);
    return null;
View Full Code Here

        return rowSpan;
    }

    public void write(PdbOutputStream out) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        super.write(new PdbOutputStream(baos));
        byte[] data = baos.toByteArray();
        out.writeByte(0);
        out.writeByte(Function.TABLE_CELL);
        out.writeByte(alignment);
        // TODO: Image record ID
View Full Code Here

        return recordId;
    }

    public final void write(PdbOutputStream out) throws IOException {
        ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
        PdbOutputStream pdb = new PdbOutputStream(dataStream);
        Paragraph[] paragraphs = writeData(pdb);
        byte[] data = dataStream.toByteArray();
        int uncompressedSize = data.length;
        int type = getType();
        // TODO: Add support for TABLE_COMPRESSED
View Full Code Here

        if (number > 99) {
          margin += 5;
        }

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PdbOutputStream out = new PdbOutputStream(baos);
        new Text(number + ". ", "ISO-8859-1").write(out);
        out.writeByte(0);
        new Margin(margin, 0).write(out);
        out.close();
        content = baos.toByteArray();
      } catch (IOException e) {
        // Should not occur
        throw new RuntimeException(e);
      }
View Full Code Here

TOP

Related Classes of net.sf.jpluck.palm.PdbOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.