Examples of asIntBuffer()


Examples of java.nio.ByteBuffer.asIntBuffer()

            } else if (out instanceof DataBufferInt) {
                int[] a = ((DataBufferInt)out).getData();
                if (depth() == IPL_DEPTH_8U || depth() == IPL_DEPTH_8S) {
                    in = in.order(ByteOrder.LITTLE_ENDIAN);
                }
                flipCopyWithGamma(in.asIntBuffer(), widthStep()/4, IntBuffer.wrap(a, start, a.length - start), step, gamma, flip);
            } else if (out instanceof DataBufferShort) {
                short[] a = ((DataBufferShort)out).getData();
                flipCopyWithGamma(in.asShortBuffer(), widthStep()/2, ShortBuffer.wrap(a, start, a.length - start), step, true, gamma, flip);
            } else if (out instanceof DataBufferUShort) {
                short[] a = ((DataBufferUShort)out).getData();
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

            } else if (in instanceof DataBufferInt) {
                int[] a = ((DataBufferInt)in).getData();
                if (depth() == IPL_DEPTH_8U || depth() == IPL_DEPTH_8S) {
                    out = out.order(ByteOrder.LITTLE_ENDIAN);
                }
                flipCopyWithGamma(IntBuffer.wrap(a, start, a.length - start), step, out.asIntBuffer(), widthStep()/4, gamma, false);
            } else if (in instanceof DataBufferShort) {
                short[] a = ((DataBufferShort)in).getData();
                flipCopyWithGamma(ShortBuffer.wrap(a, start, a.length - start), step, out.asShortBuffer(), widthStep()/2, true, gamma, false);
            } else if (in instanceof DataBufferUShort) {
                short[] a = ((DataBufferUShort)in).getData();
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

        ByteBuffer buf = null;
        Type type = fs.getType();
        if (type.getName().equals(CAS.TYPE_NAME_INTEGER_ARRAY)) {
          arrayStart = getArrayStartAddress(fs.getAddress());
          buf = ByteBuffer.allocate(arraySize * 4);
          IntBuffer intbuf = buf.asIntBuffer();
          intbuf.put(this.getHeap().heap, arrayStart, arraySize);
          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_FLOAT_ARRAY)) {
          arrayStart = getArrayStartAddress(fs.getAddress());
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    this(makeByteArray(buffer));
  }

  private static byte[] makeByteArray(int[] buffer) {
    ByteBuffer target = ByteBuffer.allocate(buffer.length * 4);
    target.asIntBuffer().put(IntBuffer.wrap(buffer));
    return target.array();
  }

  public final void beginChunk() throws IOException {
    currentFrame.push();
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

  public static final int makeName(String mnemonic) {
    ByteBuffer buffer = ByteBuffer.allocate(4);
    for (int n = 0; n < buffer.limit(); n++)
      buffer.put(characterOrSpace(mnemonic, n));
    buffer.rewind();
    return buffer.asIntBuffer().get();
  }

  private static byte characterOrSpace(String mnemonic, int n) {
    return (byte) (n < mnemonic.length() ? mnemonic.charAt(n) : ' ');
  }
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

            {
                buffer.setData(newData.asShortBuffer().array());
            }
            else if (Format.intArray.equals(dataClass))
            {
                buffer.setData(newData.asIntBuffer().array());
            }

            // Updates the buffer length.
            buffer.setLength(toIndex - fromIndex);
        }
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

        }
    }

    protected void write(FileChannel channel, EntryArray ea) throws IOException {
        ByteBuffer b = IOUtils.allocate(ea.getSize() * IOUtils.INT_SIZE);
        IntBuffer ib = b.asIntBuffer();
        for (int i = 0; i < ea.getSize(); i++) {
            ib.put(ea.getEntry(i));
        }
        ib.rewind();
        channel.write(b);
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

        return segment + "_" + term;
    }

    public byte[] getPostings() {
        ByteBuffer bytes = ByteBuffer.allocate(doccount * 4);
        IntBuffer ib = bytes.asIntBuffer();
        ib.put(docs.ints, 0, doccount);
        return bytes.array();
    }
}
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

                String key = segment + "_" + add.text();
                if (!redis.exists(key)) {
                    // New key - just add it with the current bitset
                    //int[] docset = new int[docs.cardinality()];
                    ByteBuffer bytes = ByteBuffer.allocate(docs.cardinality() * 4);
                    IntBuffer docset = bytes.asIntBuffer();
                    for (int i = docs.nextSetBit(0), j = 0; i >= 0; i = docs.nextSetBit(i + 1), j++) {
                        docset.put(j, i);
                    }
                    redis.set(key, bytes.array());
                }
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

                                spos = upto;
                            }
                        }
                    }
                    ByteBuffer bb = ByteBuffer.allocate(newpostings.length * 4);
                    bb.asIntBuffer().put(newpostings);
                    redis.set(key, bb.array());
                }
            }
            for (Term del : diff.getDeletes()) {
                String key = segment + "_" + del.text();
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.