Package org.dict.zip
Class RandomAccessOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.dict.zip.RandomAccessOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class RandomAccessOutputStream extends OutputStream
OutputStream class supporting random access methods.
-
-
Constructor Summary
Constructors Constructor Description RandomAccessOutputStream(RandomAccessFile outFile)
Construct RandomAccessOutputStream from file.RandomAccessOutputStream(String file, String mode)
Construct RandomAccessOutputStream from filename.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
seek(long pos)
Seek file position.void
write(byte[] buf, int off, int len)
void
write(int b)
-
Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write
-
-
-
-
Constructor Detail
-
RandomAccessOutputStream
public RandomAccessOutputStream(RandomAccessFile outFile)
Construct RandomAccessOutputStream from file.- Parameters:
outFile
- RamdomAccessFile
-
RandomAccessOutputStream
public RandomAccessOutputStream(String file, String mode) throws IOException
Construct RandomAccessOutputStream from filename.- Parameters:
file
- to write with random access.mode
- open mode.- Throws:
IOException
- if an I/O error has occurred.
-
-
Method Detail
-
write
public final void write(byte[] buf, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public final void write(int b) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
seek
public final void seek(long pos) throws IOException
Seek file position.- Parameters:
pos
- file position in byte.- Throws:
IOException
- if an I/O error has occurred.
-
-