Examples of openReadChannel()


Examples of com.google.appengine.api.files.FileService.openReadChannel()

            if (b.length > 0) {
              FileService fileService = FileServiceFactory
                  .getFileService();
              AppEngineFile file = fileService
                  .getBlobFile(blobKey);
              FileReadChannel readChannel = fileService
                  .openReadChannel(file, false);
              InputStream is = Channels
                  .newInputStream(readChannel);
              int nRead;
              byte[] buffer = new byte[10240];
View Full Code Here

Examples of com.google.appengine.api.files.FileService.openReadChannel()

    if(blobInfo==null) notFound();
    response.setContentTypeIfNotSet(blobInfo.getContentType());
    FileService fileService = FileServiceFactory.getFileService();
    AppEngineFile file = fileService.getBlobFile(blobKey);
    boolean lock = false;
    FileReadChannel readChannel = fileService.openReadChannel(file, lock);
    InputStream inputStream = Channels.newInputStream(readChannel);
    renderBinary(inputStream);
  }
 
}
View Full Code Here

Examples of com.google.appengine.tools.cloudstorage.GcsService.openReadChannel()


    GcsInputChannel readChannel = null;
    BufferedReader reader = null;
    try {
      readChannel = gcsService.openReadChannel(filename, 0);
      reader = new BufferedReader(Channels.newReader(readChannel, "UTF8"));
      String line;
      while ((line = reader.readLine()) != null) {
        resp.getWriter().println("READ:" + line);
      }
View Full Code Here

Examples of com.google.appengine.tools.cloudstorage.GcsService.openReadChannel()

            if (metadata == null) {
                throw new IllegalStateException("Null GCS metadata: " + filename);
            }
            mimeType = metadata.getOptions().getMimeType();

            try (InputStream inputStream = Channels.newInputStream(service.openReadChannel(metadata.getFilename(), 0))) {
                IOUtils.copyStream(inputStream, outputStream);
            }
            outputStream.write("_123".getBytes());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.