public abstract class DataObject extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
DataObject(File parentDir,
File fileObject,
long offset,
long size) |
protected |
DataObject(URL parentDir,
File fileObject,
long offset,
long size) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
getBuffer()
Gets a
ByteBuffer for accessing the data object. |
URL |
getDataFile()
Gets a url that refers to the data file for this object.
|
InputStream |
getInputStream()
Gets an input stream to the data object.
|
long |
getOffset()
Gets the offset within the data file where the object data begins.
|
long |
getSize()
Gets the size of the data object within the data file.
|
protected void |
setSize(long newSize) |
protected DataObject(File parentDir, File fileObject, long offset, long size) throws IOException
IOExceptionprotected DataObject(URL parentDir, File fileObject, long offset, long size) throws IOException
IOExceptionpublic URL getDataFile() throws MalformedURLException
URL for the file containing the data objectMalformedURLExceptionpublic long getOffset()
public long getSize()
protected void setSize(long newSize)
public InputStream getInputStream() throws FileNotFoundException, IOException
FileNotFoundException - if the data file cannot be foundIOException - if there is an error reading the data filepublic ByteBuffer getBuffer() throws FileNotFoundException, IOException
ByteBuffer for accessing the data object. The buffer is
read-only, and represents only the portion of the data file containing
the data object.ByteBuffer for reading bytes from the data objectFileNotFoundException - if the data file cannot be foundIOException - if there is an error reading the data fileCopyright © 2010–2017 Planetary Data System. All rights reserved.