Package java.nio

Examples of java.nio.ByteBuffer.asIntBuffer()


    ByteBuffer bb=ByteBuffer.allocate(bbLen);
    _useBinSearch = in.readBoolean();
    if (_useBinSearch) {
      in.readFully(bb.array());
      _indices = new int[bbLen/4];
      IntBuffer ib = bb.asIntBuffer();
      ib.get(_indices);
      bb=ByteBuffer.allocate(bbLen);
    }
    in.readFully(bb.array());
    FloatBuffer fb = bb.asFloatBuffer();
View Full Code Here


      int bbLen = _data.length * 4;
      out.writeInt(bbLen);
      out.writeBoolean(_useBinSearch);
      ByteBuffer bb=ByteBuffer.allocate(bbLen);
      if (_useBinSearch) {
        IntBuffer ib = bb.asIntBuffer();
        ib.put(_indices);
        out.write(bb.array());
        bb=ByteBuffer.allocate(bbLen);
      }
      FloatBuffer fb = bb.asFloatBuffer();
View Full Code Here

   
  public void readFields(DataInput in) throws IOException {
    int bbLen = in.readInt();
    ByteBuffer bb=ByteBuffer.allocate(bbLen);
    in.readFully(bb.array());
    IntBuffer ib = bb.asIntBuffer();
    _e = new int[bbLen/4];
    ib.get(_e);
    eLen = _e.length;

    if (_nullValues == null)
View Full Code Here

    _nullValues.readFields(in);
 
    bbLen = in.readInt();
    bb=ByteBuffer.allocate(bbLen);
    in.readFully(bb.array());
    ib = bb.asIntBuffer();
    _ef = new int[bbLen/4];
    ib.get(_ef);
   
    bb=ByteBuffer.allocate(bbLen);
    in.readFully(bb.array());
View Full Code Here

  public void write(DataOutput out) throws IOException {
    int bbLen = eLen * 4;
    out.writeInt(bbLen);
    ByteBuffer bb=ByteBuffer.allocate(bbLen);
    IntBuffer ib = bb.asIntBuffer();
    ib.put(_e, 0, eLen);
    out.write(bb.array());

    _nullValues.write(out);
   
View Full Code Here

    _nullValues.write(out);
   
    bbLen = indexLen * 4;
    out.writeInt(bbLen);
    bb=ByteBuffer.allocate(bbLen);
    ib=bb.asIntBuffer();
    ib.put(_ef, 0, indexLen);
    out.write(bb.array());
   
    bb=ByteBuffer.allocate(bbLen);
    FloatBuffer fb=bb.asFloatBuffer();
View Full Code Here

      new IntBufferIndexedIntsObjectStrategy();

  public static IntBufferIndexedInts fromArray(int[] array)
  {
    final ByteBuffer buffer = ByteBuffer.allocate(array.length * Ints.BYTES);
    buffer.asIntBuffer().put(array);

    return new IntBufferIndexedInts(buffer.asReadOnlyBuffer());
  }

  public static IntBufferIndexedInts fromIntList(IntList intList)
View Full Code Here

  }

  public static IntBufferIndexedInts fromIntList(IntList intList)
  {
    final ByteBuffer buffer = ByteBuffer.allocate(intList.length() * Ints.BYTES);
    final IntBuffer intBuf = buffer.asIntBuffer();

    for (int i = 0; i < intList.length(); ++i) {
      intBuf.put(intList.get(i));
    }

View Full Code Here

        // socket is null when we finish close()
        if (socketChannel == null)
            return;
        try {
            ByteBuffer buffer = ByteBuffer.allocate(4);
            buffer.asIntBuffer().put(-1);
            synchronized (sendMutex) {
                socketChannel.write(buffer);
                socketChannel.socket().shutdownOutput();
            }
            // were we allready closing??   
View Full Code Here

        // socket is null when we finish close()
        if (socketChannel == null)
            return;
        try {
            ByteBuffer buffer = ByteBuffer.allocate(4);
            buffer.asIntBuffer().put(-1);
            synchronized (sendMutex) {
                socketChannel.write(buffer);
                socketChannel.socket().shutdownOutput();
            }
            // were we allready closing??   
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.