Package com.google.appengine.tools.cloudstorage

Examples of com.google.appengine.tools.cloudstorage.GcsInputChannel


      BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
      BlobKey blobKey = blobstoreService.createGsBlobKey(
          "/gs/" + fileName.getBucketName() + "/" + fileName.getObjectName());
      blobstoreService.serve(blobKey, resp);
    } else {
      GcsInputChannel readChannel = gcsService.openPrefetchingReadChannel(fileName, 0, BUFFER_SIZE);
      copy(Channels.newInputStream(readChannel), resp.getOutputStream());
    }
  }
View Full Code Here


    writeChannel.close();
    resp.getWriter().println("Done writing...");


    GcsInputChannel readChannel = null;
    BufferedReader reader = null;
    try {
      readChannel = gcsService.openReadChannel(filename, 0);
      reader = new BufferedReader(Channels.newReader(readChannel, "UTF8"));
      String line;
View Full Code Here

   * 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();
    }
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.tools.cloudstorage.GcsInputChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.