@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (this.numBlocksRemaining <= 0) { this.reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in // the next lines if (current != null) { sendReadRequest(current); } // get the next segment this.numBlocksRemaining--; return this.reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (this.numBlocksRemaining <= 0) { this.reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in // the next lines if (current != null) { sendReadRequest(current); } // get the next segment this.numBlocksRemaining--; return this.reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (this.numBlocksRemaining <= 0) { this.reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in // the next lines if (current != null) { sendReadRequest(current); } // get the next segment this.numBlocksRemaining--; return this.reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (this.numBlocksRemaining <= 0) { this.reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in // the next lines if (current != null) { sendReadRequest(current); } // check if next segment is the first block isFirstBlock = (current == null); // get the next segment this.numBlocksRemaining--; return this.reader.getNextReturnedBlock(); }