Examples of FixedByteArrayOutputStream


Examples of org.apache.accumulo.core.client.lexicoder.impl.FixedByteArrayOutputStream

    try {
      byte[] bytes = v.toByteArray();
     
      byte[] ret = new byte[4 + bytes.length];
     
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
     
      // flip the sign bit
      bytes[0] = (byte) (0x80 ^ bytes[0]);
     
      int len = bytes.length;
View Full Code Here

Examples of org.apache.accumulo.core.client.lexicoder.impl.FixedByteArrayOutputStream

   */
  @Override
  public byte[] encode(UUID uuid) {
    try {
      byte ret[] = new byte[16];
      DataOutputStream out = new DataOutputStream(new FixedByteArrayOutputStream(ret));
     
      out.writeLong(uuid.getMostSignificantBits() ^ 0x8000000000000000l);
      out.writeLong(uuid.getLeastSignificantBits() ^ 0x8000000000000000l);
     
      out.close();
View Full Code Here

Examples of org.apache.gora.accumulo.util.FixedByteArrayOutputStream

  }
 
  public byte[] encodeShort(short s, byte ret[]) {
    try {
      @SuppressWarnings("resource")
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
      dos.writeShort(s);
      return ret;
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
View Full Code Here

Examples of org.apache.gora.accumulo.util.FixedByteArrayOutputStream

  }
 
  public byte[] encodeInt(int i, byte ret[]) {
    try {
      @SuppressWarnings("resource")
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
      dos.writeInt(i);
      return ret;
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
View Full Code Here

Examples of org.apache.gora.accumulo.util.FixedByteArrayOutputStream

  }
 
  public byte[] encodeLong(long l, byte ret[]) {
    try {
      @SuppressWarnings("resource")
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
      dos.writeLong(l);
      return ret;
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
View Full Code Here

Examples of org.apache.gora.accumulo.util.FixedByteArrayOutputStream

 
  public byte[] encodeDouble(double d, byte[] ret) {
    try {
      long l = Double.doubleToRawLongBits(d);
      @SuppressWarnings("resource")
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
      dos.writeLong(l);
      return ret;
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
View Full Code Here

Examples of org.apache.gora.accumulo.util.FixedByteArrayOutputStream

 
  public byte[] encodeFloat(float f, byte[] ret) {
    try {
      int i = Float.floatToRawIntBits(f);
      @SuppressWarnings("resource")
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
      dos.writeInt(i);
      return ret;
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
View Full Code Here

Examples of org.apache.gora.accumulo.util.FixedByteArrayOutputStream

  }
 
  public byte[] encodeBoolean(boolean b, byte[] ret) {
    try {
      @SuppressWarnings("resource")
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
      dos.writeBoolean(b);
      return ret;
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
View Full Code Here

Examples of org.apache.gora.accumulo.util.FixedByteArrayOutputStream

    return encodeShort(s, new byte[2]);
  }
 
  public byte[] encodeShort(short s, byte ret[]) {
    try {
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
      dos.writeShort(s);
      return ret;
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
View Full Code Here

Examples of org.apache.gora.accumulo.util.FixedByteArrayOutputStream

    return encodeInt(i, new byte[4]);
  }
 
  public byte[] encodeInt(int i, byte ret[]) {
    try {
      DataOutputStream dos = new DataOutputStream(new FixedByteArrayOutputStream(ret));
      dos.writeInt(i);
      return ret;
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
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.