Class BlobstoreInputStream
java.lang.Object
java.io.InputStream
com.google.appengine.api.blobstore.BlobstoreInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
BlobstoreInputStream provides an InputStream view of a blob in
Blobstore.
It is thread compatible but not thread safe: there is no static state, but
any multithreaded use must be externally synchronized.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA subclass ofIOExceptionthat indicates that there was a problem interacting with Blobstore.static final classA subclass ofIOExceptionthat indicates operations on a stream after it is closed. -
Constructor Summary
ConstructorsConstructorDescriptionBlobstoreInputStream(BlobKey blobKey) Creates a BlobstoreInputStream that reads data from the blob indicated by blobKey, starting at the beginning of the blob.BlobstoreInputStream(BlobKey blobKey, long offset) Creates a BlobstoreInputStream that reads data from the blob indicated by blobKey, starting at offset. -
Method Summary
Methods inherited from class java.io.InputStream
available, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
BlobstoreInputStream
Creates a BlobstoreInputStream that reads data from the blob indicated by blobKey, starting at offset.- Parameters:
blobKey- A valid BlobKey indicating the blob to read from.offset- An offset to start from.- Throws:
BlobstoreInputStream.BlobstoreIOException- If the blobKey given is invalid.IllegalArgumentException- Ifoffset< 0.IOException
-
BlobstoreInputStream
Creates a BlobstoreInputStream that reads data from the blob indicated by blobKey, starting at the beginning of the blob.- Parameters:
blobKey- A valid BlobKey indicating the blob to read from.- Throws:
BlobstoreInputStream.BlobstoreIOException- If the blobKey given is invalid.IllegalArgumentException- Ifoffset< 0.IOException
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- - does not actually throw but as it's part of our public API and removing it can cause compilation errors, leaving it in (and documenting to quiet Eclipse warning).
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-