Codota Logo
GridFileReader.closeReadStream
Code IndexAdd Codota to your IDE (free)

How to use
closeReadStream
method
in
org.deegree.coverage.raster.io.grid.GridFileReader

Best Java code snippets using org.deegree.coverage.raster.io.grid.GridFileReader.closeReadStream (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: deegree/deegree3

public void dispose() {
  leaveStreamOpen( false );
  try {
    closeReadStream();
  } catch ( IOException e ) {
    if ( LOG.isDebugEnabled() ) {
      LOG.debug( "(Stack) Exception occurred: " + e.getLocalizedMessage(), e );
    } else {
      LOG.error( "Exception occurred: " + e.getLocalizedMessage() );
    }
  }
}
origin: deegree/deegree3

@Override
protected void read( int columnId, int rowId, ByteBuffer buffer )
            throws IOException {
  int tileId = getTileId( columnId, rowId );
  long begin = System.currentTimeMillis();
  int tileInBlob = tileId % getTilesPerBlob();
  // transfer the data from the blob
  try {
    synchronized ( LOCK ) {
      FileChannel channel = getFileChannel();
      // MappedByteBuffer map = channel.map( MapMode.READ_ONLY, tileInBlob * getBytesPerTile(),
      // buffer.remaining() );
      // buffer.put( map );
      // map.
      // LOG.debug( "Tile id: {} -> pos in blob: {}", tileId, +tileInBlob );
      channel.position( tileInBlob * getBytesPerTile() );
      channel.read( buffer );
      closeReadStream();
    }
    // rewinding is not an option, buffer.rewind();
  } catch ( IOException e ) {
    LOG.error( "Error reading tile data from blob: " + e.getMessage(), e );
  }
  long elapsed = System.currentTimeMillis() - begin;
  if ( LOG.isDebugEnabled() ) {
    LOG.debug( "Loading of tile ({}x{}) in {} ms.", new Object[] { infoFile.getTileRasterWidth(),
                                   infoFile.getTileRasterHeight(), elapsed } );
  }
}
origin: deegree/deegree3

@Override
public BufferResult read( RasterRect rect, ByteBuffer resultBuffer )
            throws IOException {
  BufferResult res = null;
  RasterRect fRect = snapToGrid( rect );
  if ( fRect != null ) {
    int[] minCRmaxCR = getIntersectingTiles( fRect );
    if ( minCRmaxCR == null ) {
      return null;
    }
    int size = fRect.width * fRect.height * sampleSize;
    if ( resultBuffer == null ) {
      resultBuffer = ByteBufferPool.allocate( size, false );
    }
    synchronized ( LOCK ) {
      FileChannel channel = getFileChannel();
      RasterRect tmpRect = new RasterRect( 0, 0, fRect.width, fRect.height );
      for ( int col = minCRmaxCR[0]; col <= minCRmaxCR[2]; ++col ) {
        for ( int row = minCRmaxCR[1]; row <= minCRmaxCR[3]; ++row ) {
          readValuesFromTile( col, row, fRect, channel, resultBuffer );
        }
      }
      res = new BufferResult( tmpRect, resultBuffer );
      closeReadStream();
    }
  }
  return res;
}
org.deegree.coverage.raster.io.gridGridFileReadercloseReadStream

Popular methods of GridFileReader

  • <init>
  • load
  • dispose
  • getBytesPerTile
  • getDataLocationId
  • getFileChannel
  • getGeoReference
  • getIntersectingTiles
  • getTile
  • getTileData
  • getTileId
  • getTilesPerBlob
  • getTileId,
  • getTilesPerBlob,
  • instantiate,
  • leaveStreamOpen,
  • read,
  • readValuesFromTile,
  • snapToGrid

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now