Class Stream
java.lang.Object
com.independentsoft.io.structuredstorage.DirectoryEntry
com.independentsoft.io.structuredstorage.Stream
- All Implemented Interfaces:
Comparable<DirectoryEntry>
Represents a virtual stream to store data. Stream is analogous to a file system file. The parent object of a stream object must be a Storage object or the RootDirectoryEntry.
-
Field Summary
Fields inherited from class com.independentsoft.io.structuredstorage.DirectoryEntry
buffer, childSid, classId, color, createdTime, directoryEntries, lastModifiedTime, leftSiblingSid, name, parent, PROPERTY_TYPE, rightSiblingSid, size, startSector, type, userFlags -
Constructor Summary
ConstructorsConstructorDescriptionStream()Initializes a new instance of the Stream class.Initializes a new instance of the Stream class and load data from the specified file.Initializes a new instance of the Stream class and load data from the specified buffer.Stream(String name, InputStream stream)Initializes a new instance of the Stream class and load data from the specified System.IO.Stream. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Gets streams data.Gets InputStream to read data from this stream.voidLoads data to this stream from the specified file.voidLoads data to this stream from the specified buffer.voidload(String name, InputStream inputStream)Loads data to this stream from the specified InputStream.voidsave(OutputStream stream)Saves data from this stream to the specified stream.voidSaves data from this stream to to the specified file.voidsetBuffer(byte[] buffer)Sets streams data.Methods inherited from class com.independentsoft.io.structuredstorage.DirectoryEntry
compareTo, getClassId, getCreatedTime, getLastModifiedTime, getName, getSize, setClassId, setName
-
Constructor Details
-
Stream
public Stream()Initializes a new instance of the Stream class. -
Stream
Initializes a new instance of the Stream class and load data from the specified file.- Parameters:
filePath- the file path- Throws:
IOException- Signals that an I/O exception has occurred.
-
Stream
Initializes a new instance of the Stream class and load data from the specified System.IO.Stream.- Parameters:
name- the namestream- the stream- Throws:
IOException- Signals that an I/O exception has occurred.
-
Stream
Initializes a new instance of the Stream class and load data from the specified buffer.- Parameters:
name- the namebuffer- the buffer
-
-
Method Details
-
load
Loads data to this stream from the specified file.- Parameters:
filePath- the file path- Throws:
IOException- Signals that an I/O exception has occurred.
-
load
Loads data to this stream from the specified InputStream.- Parameters:
name- the nameinputStream- the input stream- Throws:
IOException- Signals that an I/O exception has occurred.
-
load
Loads data to this stream from the specified buffer.- Parameters:
name- the namebuffer- the buffer
-
save
Saves data from this stream to to the specified file.- Parameters:
filePath- the file path- Throws:
IOException- Signals that an I/O exception has occurred.
-
save
Saves data from this stream to the specified stream.- Parameters:
stream- the stream- Throws:
IOException- Signals that an I/O exception has occurred.
-
getInputStream
Gets InputStream to read data from this stream.- Returns:
- the input stream
-
getBuffer
public byte[] getBuffer()Gets streams data.- Returns:
- the buffer
-
setBuffer
public void setBuffer(byte[] buffer)Sets streams data.- Parameters:
buffer- the new buffer
-