-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public final class SynchronizedStreamAccessRomBuffer extends RomBuffer
Buffer implements thread safe in terms of underlying stream read/seek operations. Implementation isn't thread safe in terms of concurrent class instance. Current architecture is used due to implementation details of
biglibrary where concurrent operations results only in concurrent underlying big file resource usage. E.g. we can keep opened BigWigFile for file provided by http stream. Concurrent file access requires as to support concurrent http stream access. This implementation delegates all i/o to underlyingLightweightRomBufferinstance, which do seek before any read operation. All i/o operations delegation is made in synchronized sections to ensure that seek and read operations performed byLightweightRomBufferfor underlyingEndianSeekableDataInputstream are consistent.
-
-
Constructor Summary
Constructors Constructor Description SynchronizedStreamAccessRomBuffer(EndianSeekableDataInput input, ByteOrder order, Object lock, Long maxLength, Long position, Long limit)
-
Method Summary
Modifier and Type Method Description SynchronizedStreamAccessRomBufferduplicate(Long position, Long limit)Returns a new buffer sharing the data with its parent. IntArrayreadInts(Integer size)FloatArrayreadFloats(Integer size)ByteArrayreadBytes(Integer size)BytereadByte()ShortreadShort()IntegerreadInt()LongreadLong()FloatreadFloat()DoublereadDouble()StringreadCString()Unitclose()LonggetPosition()LonggetLimit()ByteOrdergetOrder()LonggetMaxLength()UnitsetPosition(Long position)UnitsetLimit(Long limit)-
Methods inherited from class org.jetbrains.bio.SynchronizedStreamAccessRomBuffer
checkHeader, hasRemaining, readUnsignedByte, readUnsignedShort -
Methods inherited from class java.lang.AutoCloseable
equals, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
duplicate
SynchronizedStreamAccessRomBuffer duplicate(Long position, Long limit)
Returns a new buffer sharing the data with its parent.
-
readFloats
FloatArray readFloats(Integer size)
-
readDouble
Double readDouble()
-
readCString
String readCString()
-
getPosition
Long getPosition()
-
getMaxLength
Long getMaxLength()
-
setPosition
Unit setPosition(Long position)
-
-
-
-