@Override
 public List<? extends InputReader<byte[]>> createReaders() {
   GcsService gcsService =
       GcsServiceFactory.createGcsService(MapReduceConstants.GCS_RETRY_PARAMETERS);
   GcsFileMetadata metadata;
   try {
     metadata = gcsService.getMetadata(file);
     if (metadata == null) {
       throw new RuntimeException("File does not exist: " + file.toString());
     }
   } catch (IOException e) {
     throw new RuntimeException("Unable to read file metadata: " + file.toString(), e);
   }
   long blobSize = metadata.getLength();
   return split(file, blobSize, shardCount);
 }
  @Override
  public BlobEntry getBlob(String fileName) throws UnexpectedServerException {
    GcsFilename gcsFileName = new GcsFilename(bucketName, fileName);

    try {

      GcsFileMetadata gcsFileMetadata = gcsService.getMetadata(gcsFileName);

      if (gcsFileMetadata == null) return null;

      if (gcsFileMetadata.getLength() == 0) return null;

      GcsInputChannel gcsInputChannel = gcsService.openReadChannel(gcsFileName, 0);

      ByteBuffer byteBuffer = ByteBuffer.allocate((int) gcsFileMetadata.getLength());
      gcsInputChannel.read(byteBuffer);

      return new BlobEntryGcsImpl(byteBuffer, gcsFileMetadata);

    } catch (IOException ex) {
      logger.log(Level.INFO, "Failed to fetch blob with name '" + fileName + "'", ex);
      throw new UnexpectedServerException();
    }
  }