Search in sources :

Example 1 with GridCoverageWritable

use of org.locationtech.geowave.adapter.raster.adapter.GridCoverageWritable in project geowave by locationtech.

the class GridCoverageWritableSerializer method read.

@Override
public GridCoverageWritable read(final Kryo arg0, final Input arg1, final Class<GridCoverageWritable> arg2) {
    final GridCoverageWritable gcw = new GridCoverageWritable();
    final byte[] data = arg1.readBytes(arg1.readInt());
    try (DataInputStream is = new DataInputStream(new ByteArrayInputStream(data))) {
        gcw.readFields(is);
    } catch (final IOException e) {
        LOGGER.error("Cannot deserialize GridCoverageWritable", e);
        return null;
    }
    return gcw;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GridCoverageWritable(org.locationtech.geowave.adapter.raster.adapter.GridCoverageWritable) IOException(java.io.IOException) DataInputStream(java.io.DataInputStream)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)1 DataInputStream (java.io.DataInputStream)1 IOException (java.io.IOException)1 GridCoverageWritable (org.locationtech.geowave.adapter.raster.adapter.GridCoverageWritable)1