public class RandomAccessOutputStream
extends java.io.OutputStream
implements java.io.DataOutput, java.io.Closeable
| Constructor and Description |
|---|
RandomAccessOutputStream(IRandomAccess handle)
Constructs a random access stream around the given handle.
|
RandomAccessOutputStream(java.lang.String file)
Constructs a random access stream around the given file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
long |
getFilePointer()
Returns the current offset within the stream.
|
boolean |
isLittleEndian()
Gets the endianness of the stream.
|
long |
length()
Returns the length of the file.
|
void |
order(boolean little)
Sets the endianness of the stream.
|
void |
seek(long pos)
Seeks to the given offset within the stream.
|
void |
skipBytes(int skip)
Advances the current offset by the given number of bytes.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(java.nio.ByteBuffer b)
Writes bytes to the stream from the given buffer.
|
void |
write(java.nio.ByteBuffer b,
int off,
int len) |
void |
write(int b) |
void |
writeBoolean(boolean v) |
void |
writeByte(int v) |
void |
writeBytes(java.lang.String s) |
void |
writeChar(int v) |
void |
writeChars(java.lang.String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLine(java.lang.String s)
Writes the given string followed by a newline character.
|
void |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(java.lang.String str) |
public RandomAccessOutputStream(java.lang.String file)
throws java.io.IOException
file - Filename to open the stream for.java.io.IOException - If there is a problem opening the file.public RandomAccessOutputStream(IRandomAccess handle)
handle - Handle to open the stream for.public void seek(long pos)
throws java.io.IOException
java.io.IOExceptionpublic long getFilePointer()
throws java.io.IOException
java.io.IOExceptionpublic long length()
throws java.io.IOException
java.io.IOExceptionpublic void skipBytes(int skip)
throws java.io.IOException
java.io.IOExceptionpublic void order(boolean little)
public boolean isLittleEndian()
public void writeLine(java.lang.String s)
throws java.io.IOException
java.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in interface java.io.DataOutputwrite in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in interface java.io.DataOutputwrite in class java.io.OutputStreamjava.io.IOExceptionpublic void write(java.nio.ByteBuffer b)
throws java.io.IOException
b - Source buffer to read data from.java.io.IOException - If there is an error writing to the stream.public void write(java.nio.ByteBuffer b,
int off,
int len)
throws java.io.IOException
b - Source buffer to read data from.off - Offset within the buffer to start reading from.len - Number of bytes to read.java.io.IOException - If there is an error writing to the stream.public void write(int b)
throws java.io.IOException
write in interface java.io.DataOutputwrite in class java.io.OutputStreamjava.io.IOExceptionpublic void writeBoolean(boolean v)
throws java.io.IOException
writeBoolean in interface java.io.DataOutputjava.io.IOExceptionpublic void writeByte(int v)
throws java.io.IOException
writeByte in interface java.io.DataOutputjava.io.IOExceptionpublic void writeBytes(java.lang.String s)
throws java.io.IOException
writeBytes in interface java.io.DataOutputjava.io.IOExceptionpublic void writeChar(int v)
throws java.io.IOException
writeChar in interface java.io.DataOutputjava.io.IOExceptionpublic void writeChars(java.lang.String s)
throws java.io.IOException
writeChars in interface java.io.DataOutputjava.io.IOExceptionpublic void writeDouble(double v)
throws java.io.IOException
writeDouble in interface java.io.DataOutputjava.io.IOExceptionpublic void writeFloat(float v)
throws java.io.IOException
writeFloat in interface java.io.DataOutputjava.io.IOExceptionpublic void writeInt(int v)
throws java.io.IOException
writeInt in interface java.io.DataOutputjava.io.IOExceptionpublic void writeLong(long v)
throws java.io.IOException
writeLong in interface java.io.DataOutputjava.io.IOExceptionpublic void writeShort(int v)
throws java.io.IOException
writeShort in interface java.io.DataOutputjava.io.IOExceptionpublic void writeUTF(java.lang.String str)
throws java.io.IOException
writeUTF in interface java.io.DataOutputjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionCopyright © 2014 Open Microscopy Environment