Examples of ByteSequence


Examples of com.intellij.openapi.util.io.ByteSequence

    myPath = path;
    myFile = new File(path);
    mySize = myFile.length();

    if (mySize == 0) {
      appendBytes(new ByteSequence("Header Record For PersistentHashMapValuStorage".getBytes()), 0);
    }
  }
View Full Code Here

Examples of com.sun.org.apache.bcel.internal.util.ByteSequence

   * Initialize instruction list from byte array.
   *
   * @param code byte array containing the instructions
   */
  public InstructionList(byte[] code) {
    ByteSequence        bytes = new ByteSequence(code);
    InstructionHandle[] ihs   = new InstructionHandle[code.length];
    int[]               pos   = new int[code.length]; // Can't be more than that
    int                 count = 0; // Contains actual length

    /* Pass 1: Create an object for each byte code and append them
     * to the list.
     */
    try {
      while(bytes.available() > 0) {
  // Remember byte offset and associate it with the instruction
  int off =  bytes.getIndex();
  pos[count] = off;
 
  /* Read one instruction from the byte stream, the byte position is set
   * accordingly.
   */
 
View Full Code Here

Examples of com.sun.org.apache.bcel.internal.util.ByteSequence

  /**
   * @return an array of instructions without target information for branch instructions.
   */
  public Instruction[] getInstructions() {
    ByteSequence  bytes        = new ByteSequence(getByteCode());
    ArrayList     instructions = new ArrayList();

    try {
      while(bytes.available() > 0) {
  instructions.add(Instruction.readInstruction(bytes));
      }
    } catch(IOException e) { throw new ClassGenException(e.toString()); }

    Instruction[] result = new Instruction[instructions.size()];
View Full Code Here

Examples of com.sun.org.apache.bcel.internal.util.ByteSequence

  public static final String codeToString(byte[] code,
            ConstantPool constant_pool,
            int index, int length, boolean verbose)
  {
    StringBuffer buf    = new StringBuffer(code.length * 20); // Should be sufficient
    ByteSequence stream = new ByteSequence(code);

    try {
      for(int i=0; i < index; i++) // Skip `index' lines of code
  codeToString(stream, constant_pool, verbose);

      for(int i=0; stream.available() > 0; i++) {
  if((length < 0) || (i < length)) {
    String indices = fillup(stream.getIndex() + ":", 6, true, ' ');
    buf.append(indices + codeToString(stream, constant_pool, verbose) + '\n');
  }
      }
    } catch(IOException e) {
      System.out.println(buf.toString());
View Full Code Here

Examples of de.fub.bytecode.util.ByteSequence

   * Initialize instruction list from byte array.
   *
   * @param code byte array containing the instructions
   */
  public InstructionList(byte[] code) {
    ByteSequence        bytes = new ByteSequence(code);
    InstructionHandle[] ihs   = new InstructionHandle[code.length];
    int[]               pos   = new int[code.length]; // Can't be more than that
    int                 count = 0; // Contains actual length

    /* Pass 1: Create an object for each byte code and append them
     * to the list.
     */
    try {
      while(bytes.available() > 0) {
  // Remember byte offset and associate it with the instruction
  int off =  bytes.getIndex();
  pos[count] = off;
 
  /* Read one instruction from the byte stream, the byte position, i.e.,
   * setPosition() will be called automatically.
   */
 
View Full Code Here

Examples of info.riemannhypothesis.crypto.tools.ByteSequence

public class Week4 {

  public static void main(String[] args) {
    // TODO Auto-generated method stub
    ByteSequence iv = ByteSequence.fromHexString("20814804c1767293b99f1d9cab3bc3e7");
    byte[] zeros = new byte[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    ByteSequence m1 = new ByteSequence("Pay Bob 100$").append(zeros);
    ByteSequence m2 = new ByteSequence("Pay Bob 500$").append(zeros);
    System.out.println("Result IV: " + iv.xor(m1).xor(m2).toHexString());
  }
View Full Code Here

Examples of org.activeio.Packet.ByteSequence

       
      ByteBuffer data;
        if( packet.getClass()==ByteBufferPacket.class ) {
            data = ((ByteBufferPacket)packet).getByteBuffer();           
        } else {
          ByteSequence sequence = packet.asByteSequence();
          data = ByteBuffer.wrap(sequence.getData(), sequence.getOffset(), sequence.getLength());
        }

        long delay=1;
        while( data.hasRemaining() ) {
         
View Full Code Here

Examples of org.apache.accumulo.core.data.ByteSequence

      return false;
   
    key = null;
   
    Iterator<Entry<Key,Value>> nextRow = iterator.next();
    ByteSequence row = getDataStore().populate(nextRow, persistent);
    key = (K) ((AccumuloStore) dataStore).fromBytes(getKeyClass(), row.toArray());
   
    return true;
  }
View Full Code Here

Examples of org.apache.accumulo.core.data.ByteSequence

  public boolean schemaExists() {
    return conn.tableOperations().exists(mapping.tableName);
  }

  public ByteSequence populate(Iterator<Entry<Key,Value>> iter, T persistent) throws IOException {
    ByteSequence row = null;
   
    Map currentMap = null;
    ArrayList currentArray = null;
    Text currentFam = null;
    int currentPos = 0;
View Full Code Here

Examples of org.apache.accumulo.core.data.ByteSequence

     
      scanner.setRange(rowRange);
      setFetchColumns(scanner, fields);
     
      T persistent = newPersistent();
      ByteSequence row = populate(scanner.iterator(), persistent);
      if (row == null)
        return null;
      return persistent;
    } catch (TableNotFoundException e) {
      LOG.error(e.getMessage());
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.