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 class
A subclass ofIOException
that indicates that there was a problem interacting with Blobstore.static final class
A subclass ofIOException
that 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in 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:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-