GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — storage: read blob in chunk will get exception when reach the end the blob · Issue #723 · googleapis/google-cloud-java Closed DescriptionFollowing code is used to read blob chunk by chunk: try (ReadChannel reader = blob.reader()) { WritableByteChannel channel = Channels.newChannel(outputStream); ByteBuffer bytes = ByteBuffer.allocate(64 * 1024); while (reader.read(bytes) > 0) { bytes.flip(); channel.write(bytes); bytes.clear(); } } reader.read() will throw exception: com.google.gcloud.storage.StorageException: java.lang.NullPointerException The root cause is, reader is blindly reading chunks from cloud storage, if it reaches beyond the end of the blob, then cloud storage will throw an error: 416 Requested range not satisfiable. Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |