Package net.apartium.cocoabeans.seekable
Class SeekableInputStream
java.lang.Object
java.io.InputStream
net.apartium.cocoabeans.seekable.SeekableInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()static SeekableInputStreamOpen a file as SeekableInputStream and if the file doesn't exist we create onelongposition()Current positionvoidposition(long newPos) Jump to new positionintread()intread(@org.jspecify.annotations.NonNull byte[] b, int off, int len) longsize()size of the entire channellongskip(long n) Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Constructor Details
-
SeekableInputStream
-
-
Method Details
-
open
Open a file as SeekableInputStream and if the file doesn't exist we create one- Parameters:
path- path to the file- Returns:
- new instance of SeekableInputStream to the file
- Throws:
IOException
-
position
Current position- Returns:
- current position
- Throws:
IOException
-
position
Jump to new position- Parameters:
newPos- memory address- Throws:
IOException
-
size
size of the entire channel- Returns:
- file size
- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-