@Override public LongsSegment finishReading() { LongsSegment result = super.finishReading(); // clear write pointer for further reuse _buffer.clear(); // and drop reference to read-wrapper: _readBuffer = null; return result; }
/** * Method that will erase any content segment may have and reset * various pointers: will be called when clearing buffer, the last * remaining segment needs to be cleared. */ @Override public void clear() { _readBuffer = null; // could/should we just reset it instead? _buffer.clear(); // clear the write pointer super.clear(); }
/** * Method that will erase any content segment may have and reset * various pointers: will be called when clearing buffer, the last * remaining segment needs to be cleared. */ @Override public void clear() { _readBuffer = null; // could/should we just reset it instead? _buffer.clear(); // clear the write pointer super.clear(); }
@Override public LongsSegment finishReading() { LongsSegment result = super.finishReading(); // clear write pointer for further reuse _buffer.clear(); // and drop reference to read-wrapper: _readBuffer = null; return result; }
@Override public LongsSegment initForReading() { super.initForReading(); _readBuffer = _buffer.asReadOnlyBuffer(); _readBuffer.clear(); return this; }
@Override public LongsSegment initForReading() { super.initForReading(); _readBuffer = _buffer.asReadOnlyBuffer(); _readBuffer.clear(); return this; }
private boolean readLogLine() throws IOException logLongArray.clear();
private ByteBuffer reconstructBuffer(long timestamp) { dataBuffer.clear(); dataBufferAsLong.clear(); dataBufferAsLong.put(timestamp); for(int i = 0; i < variables.size();i++) { dataBufferAsLong.put(variables.get(i).getValueAsLongBits()); } for(int i = 0; i < jointStates.size(); i++) { jointStates.get(i).get(dataBufferAsLong); } dataBufferAsLong.flip(); dataBuffer.clear(); return dataBuffer; }
/** Commodity method for loading a big list of binary longs with specified endianness into a * {@linkplain LongBigArrays long big array}. * * @param filename the file containing the longs. * @param byteOrder the endianness of the longs. * @return a big list of longs containing the longs in <code>filename</code>. */ public static LongBigArrayBigList loadLongBigList(final CharSequence filename, final ByteOrder byteOrder) throws IOException { final long length = new File(filename.toString()).length() / (Long.SIZE / Byte.SIZE); @SuppressWarnings("resource") final ReadableByteChannel channel = new FileInputStream(filename.toString()).getChannel(); final ByteBuffer byteBuffer = ByteBuffer.allocateDirect(64 * 1024).order(byteOrder); final LongBuffer longBuffer = byteBuffer.asLongBuffer(); final long[][] array = LongBigArrays.newBigArray(length); long pos = 0; while (channel.read(byteBuffer) > 0) { byteBuffer.flip(); final int remainingLongs = byteBuffer.remaining() / (Long.SIZE / Byte.SIZE); longBuffer.clear(); longBuffer.limit(remainingLongs); longBuffer.get(array[BigArrays.segment(pos)], BigArrays.displacement(pos), remainingLongs); pos += remainingLongs; byteBuffer.clear(); } channel.close(); return LongBigArrayBigList.wrap(array); }
private boolean readLogLine() throws IOException logLongArray.clear();
private boolean readLogLine() throws IOException logLongArray.clear();
private boolean readLogLine() throws IOException logLongArray.clear();
private boolean readLogLine() throws IOException logLongArray.clear();
private boolean readLogLine() throws IOException logLongArray.clear();
this.offset = offset; this.numberOfVariables = numberOfVariables; this.data.clear(); int end = offset + numberOfVariables; for (int i = offset; i < end; i++)
return; java.nio.LongBuffer buffer = bbuffer.asLongBuffer(); buffer.clear(); validateArgs(src, src.length, srcPos, buffer.limit(), destPos, length); buffer.position(destPos);