/** * Fills the entire buffer with no data values. Note this operation is only possible on writable buffers. */ public void fillWithNoData() { dataAccess.fillWithNoData(); }
/** * Prepares the byte buffer for reading / writing thus instantiates it with values (no) data; */ public void prepareBuffer() { synchronized ( LOCK ) { if ( data == null ) { data = ByteBufferPool.allocate( requiredBufferSize(), false ); boolean noData = false; if ( reader != null ) { try { BufferResult dataResult = reader.read( maxViewData, data ); if ( dataResult != null ) { data = dataResult.getResult(); data.rewind(); } // RasterRect rect = dataResult.getRect(); // lineStride = pixelStride * rect.width; } catch ( IOException e ) { LOG.debug( "No data available: " + e.getLocalizedMessage(), e ); // the data is no longer available, lets just fill it with no data values noData = true; } } if ( noData ) { fillWithNoData(); } } } }