public void getIntArray(int[] array) throws IOException { int size = array.length * 4; if(buffer.remaining() < size) refillBuffer(size); // read the array using a view IntBuffer intView = buffer.asIntBuffer(); intView.limit(array.length); intView.get(array); // don't forget to update the original buffer position, since the view is independent buffer.position(buffer.position() + size); }
public Envelope getEnvelope() throws IOException { if (!useMemoryMapping && buffer.remaining() < 32) refillBuffer(32); buffer.asDoubleBuffer().get(envelope); buffer.position(buffer.position() + 32); return new Envelope(envelope[0], envelope[2], envelope[1], envelope[3]); }
public void getIntArray(int[] array) throws IOException { int size = array.length * 4; if (buffer.remaining() < size) refillBuffer(size); // read the array using a view IntBuffer intView = buffer.asIntBuffer(); intView.limit(array.length); intView.get(array); // don't forget to update the original buffer position, since the // view is independent buffer.position(buffer.position() + size); }
public int getInt() throws IOException { if(buffer.remaining() < 4) refillBuffer(4); return buffer.getInt(); }
public void getIntArray(int[] array) throws IOException { int size = array.length * 4; if (buffer.remaining() < size) refillBuffer(size); // read the array using a view IntBuffer intView = buffer.asIntBuffer(); intView.limit(array.length); intView.get(array); // don't forget to update the original buffer position, since the // view is independent buffer.position(buffer.position() + size); }
public double getDouble() throws IOException { if(buffer.remaining() < 8) refillBuffer(8); return buffer.getDouble(); }
public int getInt() throws IOException { if(!useMemoryMapping && buffer.remaining() < 4) { refillBuffer(4); } return buffer.getInt(); }
public Envelope getEnvelope() throws IOException { if (!useMemoryMapping && buffer.remaining() < 32) refillBuffer(32); buffer.asDoubleBuffer().get(envelope); buffer.position(buffer.position() + 32); return new Envelope(envelope[0], envelope[2], envelope[1], envelope[3]); }
public int getInt() throws IOException { if(!useMemoryMapping && buffer.remaining() < 4) { refillBuffer(4); } return buffer.getInt(); }