Examples of toByteArray()


Examples of com.peterhi.runtime.Buffer.toByteArray()

    }
   
    {
      byte[] existingData = new byte[] { (byte )254, (byte )254 };
      Buffer testBuffer = new Buffer(existingData, 2, 8, true);
      assertArrayEquals(new byte[] { (byte )191 }, testBuffer.toByteArray(Buffer.COPY_METHOD_ALL_DATA));
    }
   
    try {
      Buffer nullExistingDataOffsetLengthBits = new Buffer(null, 0, 0, false);
      fail();
View Full Code Here

Examples of com.peterhi.runtime.MemoryStream.toByteArray()

          ms.writeShort(length);
        }
       
        ms.write(frame.getData());
       
        byte[] data = ms.toByteArray();
        DatagramPacket packet = new DatagramPacket(data, data.length);
        getSocket().send(packet);
        frame.incrementSendCount();
        return true;
      }
View Full Code Here

Examples of com.peterhi.uintx.toByteArray()

    }
  }

  private boolean writeSize(int size, boolean nullable) throws IOException {
    uintx u = new uintx(size + (nullable ? 1 : 0));
    write(u.toByteArray());
    return nullable ? (size != -1) : true;
   
  }
 
  private void writeIndex(PropModel model, PmLookup lookup)
View Full Code Here

Examples of com.samskivert.io.ByteArrayOutInputStream.toByteArray()

            stat.persistTo(new ObjectOutputStream(out), this);
        } catch (IOException ioe) {
            throw new DatabaseException("Error serializing stat " + stat, ioe);
        }

        byte[] data = out.toByteArray();
        byte nextModCount = (byte)((stat.getModCount() + 1) % Byte.MAX_VALUE);
        Key<StatRecord> key = StatRecord.getKey(playerId, stat.getCode());

        // update the row in the database only if it has the expected modCount
        int numRows = updatePartial(
View Full Code Here

Examples of com.sleepycat.asm.ClassWriter.toByteArray()

            /*
             * Pass false for skipDebug since we are rewriting the class and
             * should include all information.
             */
            reader.accept(visitor, false);
            return writer.toByteArray();
        } catch (BytecodeEnhancer.NotPersistentException e) {
            /* The class is not persistent and should not be enhanced. */
            return null;
        }
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleOutput.toByteArray()

    private byte[] intKey(long fileNum, long seqNum) {

        TupleOutput out = new TupleOutput();
        out.writeUnsignedInt(fileNum);
        out.writeUnsignedInt(seqNum);
        return out.toByteArray();
    }
}
View Full Code Here

Examples of com.sleepycat.util.FastOutputStream.toByteArray()

                    try {
                        /* Serialize classFormat first. */
                        FastOutputStream fo = new FastOutputStream();
                        ObjectOutputStream oos = new ObjectOutputStream(fo);
                        oos.writeObject(classFormat);
                        byte[] bytes = fo.toByteArray();
                        /* Then deserialize classFormat. */
                        FastInputStream fi = new FastInputStream(bytes);
                        ObjectInputStream ois = new ObjectInputStream(fi);
                        classFormat = (ObjectStreamClass) ois.readObject();
                    } catch (Exception e) {
View Full Code Here

Examples of com.sshtools.j2ssh.io.ByteArrayWriter.toByteArray()

            baw.writeString(hostToConnectOrBind);
            baw.writeInt(portToConnectOrBind);
            baw.writeString(originatingHost);
            baw.writeInt(originatingPort);

            return baw.toByteArray();
        } catch (IOException ioe) {
            return null;
        }
    }
View Full Code Here

Examples of com.sshtools.j2ssh.util.SimpleASNWriter.toByteArray()

            SimpleASNWriter asnEncoded = new SimpleASNWriter();
            asnEncoded.writeByte(0x30);
            asnEncoded.writeData(asn.toByteArray());

            byte[] encoded = asnEncoded.toByteArray();

            if (log.isDebugEnabled()) {
                log.debug("Verifying host key signature");
                log.debug("Signature length is " +
                    String.valueOf(signature.length));
View Full Code Here

Examples of com.sun.corba.ee.impl.encoding.CDROutputObject.toByteArray()

  boolean stateful = false;
  CompoundSecMechList list = new CompoundSecMechList(
      stateful, mechList);
  CompoundSecMechListHelper.write(out, list);
  byte[] buf = out.toByteArray();
  org.omg.IOP.TaggedComponent tc = new org.omg.IOP.TaggedComponent(
      TAG_CSI_SEC_MECH_LIST.value, buf ) ;
  return tc;
    }
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.