Package com.twelvemonkeys.io
Class RandomAccessStream.OutputStreamView
- java.lang.Object
-
- java.io.OutputStream
-
- com.twelvemonkeys.io.SeekableOutputStream
-
- com.twelvemonkeys.io.RandomAccessStream.OutputStreamView
-
- All Implemented Interfaces:
Seekable
,java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
- Enclosing class:
- RandomAccessStream
static final class RandomAccessStream.OutputStreamView extends SeekableOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private RandomAccessStream
mStream
-
Fields inherited from class com.twelvemonkeys.io.SeekableOutputStream
closed, flushedPosition, markedPositions, position
-
-
Constructor Summary
Constructors Constructor Description OutputStreamView(RandomAccessStream pStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeImpl()
protected void
flushBeforeImpl(long pPosition)
boolean
isCached()
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards.boolean
isCachedFile()
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards, and the cache is kept in a temporary file.boolean
isCachedMemory()
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards, and the cache is kept in main memory.protected void
seekImpl(long pPosition)
void
write(byte[] pBytes, int pOffset, int pLength)
void
write(int pByte)
-
Methods inherited from class com.twelvemonkeys.io.SeekableOutputStream
checkOpen, close, flush, flushBefore, getFlushedPosition, getStreamPosition, mark, reset, seek, write
-
-
-
-
Field Detail
-
mStream
private final RandomAccessStream mStream
-
-
Constructor Detail
-
OutputStreamView
public OutputStreamView(RandomAccessStream pStream)
-
-
Method Detail
-
isCached
public boolean isCached()
Description copied from interface:Seekable
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards. Applications may consult this in order to decide how frequently, or whether, to flush in order to conserve cache resources.- Returns:
true
if thisSeekable
caches data.- See Also:
Seekable.isCachedMemory()
,Seekable.isCachedFile()
-
isCachedFile
public boolean isCachedFile()
Description copied from interface:Seekable
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards, and the cache is kept in a temporary file. Applications may consult this in order to decide how frequently, or whether, to flush in order to conserve cache resources.- Returns:
true
if thisSeekable
caches data in a temporary file.- See Also:
Seekable.isCached()
,Seekable.isCachedMemory()
-
isCachedMemory
public boolean isCachedMemory()
Description copied from interface:Seekable
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards, and the cache is kept in main memory. Applications may consult this in order to decide how frequently, or whether, to flush in order to conserve cache resources.- Returns:
true
if thisSeekable
caches data in main memory.- See Also:
Seekable.isCached()
,Seekable.isCachedFile()
-
closeImpl
protected void closeImpl() throws java.io.IOException
- Specified by:
closeImpl
in classSeekableOutputStream
- Throws:
java.io.IOException
-
flushBeforeImpl
protected void flushBeforeImpl(long pPosition) throws java.io.IOException
- Specified by:
flushBeforeImpl
in classSeekableOutputStream
- Throws:
java.io.IOException
-
seekImpl
protected void seekImpl(long pPosition) throws java.io.IOException
- Specified by:
seekImpl
in classSeekableOutputStream
- Throws:
java.io.IOException
-
write
public void write(int pByte) throws java.io.IOException
- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] pBytes, int pOffset, int pLength) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
-