Package ivory.core.compression

Examples of ivory.core.compression.BitOutputStream.writeGamma()


  public void write(DataOutput out) throws IOException {
    ByteArrayOutputStream b = new ByteArrayOutputStream();
    BitOutputStream t = new BitOutputStream(b);
    for (int i = 0; i < tf; i++) {
      if (i == 0) {
        t.writeGamma(positions[0]);
      } else {
        int pgap = positions[i] - positions[i - 1];
        if (positions[i] <= 0 || pgap == 0) {
          throw new RuntimeException("Error: invalid term positions " + toString());
        }
View Full Code Here


        int pgap = positions[i] - positions[i - 1];
        if (positions[i] <= 0 || pgap == 0) {
          throw new RuntimeException("Error: invalid term positions " + toString());
        }

        t.writeGamma(pgap);
      }
    }

    int bitOffset = t.getBitOffset();
    int byteOffset = (int) t.getByteOffset();
View Full Code Here

      try {
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        BitOutputStream t = new BitOutputStream(b);
        for (int i = 0; i < tf; i++) {
          if (i == 0) {
            t.writeGamma(positions[0]);
          } else {
            int pgap = positions[i] - positions[i - 1];
            if (positions[i] <= 0 || pgap == 0) {
              throw new RuntimeException("Error: invalid term positions " + toString());
            }
View Full Code Here

            int pgap = positions[i] - positions[i - 1];
            if (positions[i] <= 0 || pgap == 0) {
              throw new RuntimeException("Error: invalid term positions " + toString());
            }

            t.writeGamma(pgap);
          }
        }

        int bitOffset = t.getBitOffset();
        int byteOffset = (int) t.getByteOffset();
View Full Code Here

   */
  public static byte[] serializePositions(int[] positions) throws IOException {
    ByteArrayOutputStream b = new ByteArrayOutputStream();
    BitOutputStream t = new BitOutputStream(b);

    t.writeGamma(positions.length);

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
View Full Code Here

    t.writeGamma(positions.length);

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
        int pgap = positions[i] - positions[i - 1];
        t.writeGamma(pgap);
      }
    }
View Full Code Here

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
        int pgap = positions[i] - positions[i - 1];
        t.writeGamma(pgap);
      }
    }

    t.padAndFlush();
    t.close();
View Full Code Here

   */
  public static byte[] serializePositions(int[] positions) throws IOException {
    ByteArrayOutputStream b = new ByteArrayOutputStream();
    BitOutputStream t = new BitOutputStream(b);

    t.writeGamma(positions.length);

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
View Full Code Here

    t.writeGamma(positions.length);

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
        int pgap = positions[i] - positions[i - 1];
        t.writeGamma(pgap);
      }
    }
View Full Code Here

    for (int i = 0; i < positions.length; i++) {
      if (i == 0) {
        t.writeGamma(positions[0] + 1);
      } else {
        int pgap = positions[i] - positions[i - 1];
        t.writeGamma(pgap);
      }
    }

    t.padAndFlush();
    t.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.