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.IOException
public long getFilePointer() throws java.io.IOException
java.io.IOException
public long length() throws java.io.IOException
java.io.IOException
public void skipBytes(int skip) throws java.io.IOException
java.io.IOException
public void order(boolean little)
public boolean isLittleEndian()
public void writeLine(java.lang.String s) throws java.io.IOException
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.OutputStream
java.io.IOException
public 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.DataOutput
write
in class java.io.OutputStream
java.io.IOException
public void writeBoolean(boolean v) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
java.io.IOException
public void writeByte(int v) throws java.io.IOException
writeByte
in interface java.io.DataOutput
java.io.IOException
public void writeBytes(java.lang.String s) throws java.io.IOException
writeBytes
in interface java.io.DataOutput
java.io.IOException
public void writeChar(int v) throws java.io.IOException
writeChar
in interface java.io.DataOutput
java.io.IOException
public void writeChars(java.lang.String s) throws java.io.IOException
writeChars
in interface java.io.DataOutput
java.io.IOException
public void writeDouble(double v) throws java.io.IOException
writeDouble
in interface java.io.DataOutput
java.io.IOException
public void writeFloat(float v) throws java.io.IOException
writeFloat
in interface java.io.DataOutput
java.io.IOException
public void writeInt(int v) throws java.io.IOException
writeInt
in interface java.io.DataOutput
java.io.IOException
public void writeLong(long v) throws java.io.IOException
writeLong
in interface java.io.DataOutput
java.io.IOException
public void writeShort(int v) throws java.io.IOException
writeShort
in interface java.io.DataOutput
java.io.IOException
public void writeUTF(java.lang.String str) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
Copyright © 2014 Open Microscopy Environment