Examples of rewind()


Examples of java.nio.ByteBuffer.rewind()

      for (int i=0;i<payload.length;i++){
     
        temp.put( payload[i].getBuffer( DirectByteBuffer.SS_MSG ));
      }
     
      temp.rewind();
     
      initial_data = temp;
    }
           
    connection.connect(
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

            } else {
              buffer = ByteBuffer.allocate(baos.size());
            }
            buffer.order(ByteOrder.nativeOrder());
            buffer.put(baos.toByteArray());
            buffer.rewind();
        } catch (Exception ioe) {
            ioe.printStackTrace();
        }
        return buffer;
    }   
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

       
        // if ogg vorbis data, we need to pass it unmodified to alBufferData
        buffer = ByteBuffer.allocateDirect(baos.size());
        buffer.order(ByteOrder.nativeOrder());
        buffer.put(baos.toByteArray());
        buffer.rewind();
      } catch (Exception ioe) {
        ioe.printStackTrace();
      }
      return buffer;
    }   
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

             
                di.put(hashset);
               
            }
           
            di.rewind();
           
            hashset.rewind();
           
            //hashes
            byte[][] hashes = new byte[(c!=1)?(c + 1):1][16];
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

        int peerPort;
        ByteBuffer data = Misc.getByteBuffer(4);
        for (int i = 0; i < source_count; i++) {
          for (int j = 0; j < 4; j++) {
            data.clear();
            data.rewind();
            byte b = packet_data.get();
            data.put(b);
            peerID[j] = Convert.intToByte(data.getInt(0));
          }
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

     
      ByteBuffer num = Misc.getByteBuffer(4);
     
      for(FileChunkRequest request : partsData) {
        num.clear();
        num.rewind();
        num.putInt(Convert.longToInt(request.getChunkBegin()));
        packet.insertData(num.array());
      }
     
      for(FileChunkRequest request : partsData) {
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

        packet.insertData(num.array());
      }
     
      for(FileChunkRequest request : partsData) {
        num.clear();
        num.rewind();
        num.putInt(Convert.longToInt(request.getChunkEnd()));
        packet.insertData(num.array());
      }
     
      return packet;
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

                msgDigest.finalDigest(di);
            } else {
                di.put(hashset);
            }
           
            di.rewind();
            hashset.rewind();
            //hashes
            byte[][] hashes = new byte[(c!=1)?(c + 1):1][16];
            di.get(hashes[0]);
            for (int j = 1; j < hashes.length; j++) {
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

            }
        }
       
        //We have finished filling the new bytebuffer, so set the limit, and rewind
        bb.limit(bb.position());
        bb.rewind();
       
        return bb;
    }

}
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

    else {
      // Read parameters from file
      ByteBuffer buf = ByteBuffer.allocate(HEADER_LENGTH);
      fileChannel.read(buf, 0L);

      buf.rewind();

      @SuppressWarnings("unused")
      int fileFormatVersion = buf.getInt();
      this.blockSize = buf.getInt();
      this.valueSize = buf.getInt();
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.