The file takes a byte array during construction, and will return that when any content requesting methods are called. All opening methods of this file class is efficient.
Warning: This class doesn't make an internal copy of the byte array passed to it during construction. Modifying the contents of the underlying array can result in improper operation, and broken incremental builds.
public | ByteArraySakerFile( Creates a new instance with the given name and no byte contents. |
public | ByteArraySakerFile( Creates a new instance with the given name and byte array region. |
public | ByteArraySakerFile( Creates a new instance with the given name and byte array. |
public | ByteArraySakerFile( Creates a new instance with the given name and range of byte array. |
public ByteArrayRegion | Gets the raw byte contents of this file without implicit synchronization. |
public ContentDescriptor | Gets the content descriptor of this file. |
public String | Gets the string contents of this file without implicit synchronization. |
public int | Gets the efficient opening methods flag of this file. |
public InputStream | Opens an input stream to the contents of this file without implicit synchronization. |
public void | Writes the contents of this file without implicit synchronization. |
From: SakerFileBase |
From: Object |
From: SakerFile |
Generally, this constructor is not useful at all, because the created file will have no byte contents at all.
null
.null
.null
.See SakerFile.getBytes().
See ContentDescriptor. Content descriptors are used to determine if the file contents need to be persisted to the file system.
Subclasses should note that if they use posix file permissions then they should return a content descriptor that reflects this behaviour. They are recommended to use PosixFilePermissionsDelegateContentDescriptor to construct the actual content descriptor.
null
.See SakerFile.getContent().
An opening method is considered (performance-wise) efficient if it generally takes less resources (time and memory) to call the appropriate content method instead of trying to employ caching to the disk.
If an opening method is reported as efficient, then the implicit synchronizations will not take place specified by the documentation of SakerFile interface.
If an opening method is not reported as efficient, then calling content retrieval methods which do not end
with Impl
will check if the file system already has the contents of this file persisted, and will
read the contents from there if it has. If not, then the contents will be synchronized with to the disk, and the
contents will be retrieved in the most efficient manner. (This manner depends on the nature of the opening
method.)
The default implementation returns SakerFile.OPENING_METHODS_NONE.
See SakerFile.writeTo(
To call this method using a ByteSink, use ByteSink.toOutputStream(
Implementations can use ByteSink.valueOf(