* the input by at least this many bytes. (This must be at least 1kb and less than 10mb) If
* buffering is undesirable openReadChannel could be called instead, which is totally unbuffered.
*/
private Object readObjectFromFile(GcsFilename fileName)
throws IOException, ClassNotFoundException {
GcsInputChannel readChannel = gcsService.openPrefetchingReadChannel(fileName, 0, 1024 * 1024);
try (ObjectInputStream oin = new ObjectInputStream(Channels.newInputStream(readChannel))) {
return oin.readObject();
}
}