krati.io
Class ChannelWriter
java.lang.Object
krati.io.ChannelWriter
- All Implemented Interfaces:
- DataWriter
public class ChannelWriter
- extends Object
- implements DataWriter
A simple data writer based on FileChannel.
- Author:
- jwu
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChannelWriter
public ChannelWriter(File file)
getFile
public File getFile()
- Specified by:
getFile
in interface DataWriter
open
public void open()
throws IOException
- Specified by:
open
in interface DataWriter
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface DataWriter
- Throws:
IOException
flush
public void flush()
throws IOException
- Specified by:
flush
in interface DataWriter
- Throws:
IOException
writeInt
public void writeInt(int value)
throws IOException
- Specified by:
writeInt
in interface DataWriter
- Throws:
IOException
writeLong
public void writeLong(long value)
throws IOException
- Specified by:
writeLong
in interface DataWriter
- Throws:
IOException
writeShort
public void writeShort(short value)
throws IOException
- Specified by:
writeShort
in interface DataWriter
- Throws:
IOException
writeBytes
public void writeBytes(byte[] bytes)
throws IOException
- Throws:
IOException
writeInt
public void writeInt(long position,
int value)
throws IOException
- Specified by:
writeInt
in interface DataWriter
- Throws:
IOException
writeLong
public void writeLong(long position,
long value)
throws IOException
- Specified by:
writeLong
in interface DataWriter
- Throws:
IOException
writeShort
public void writeShort(long position,
short value)
throws IOException
- Specified by:
writeShort
in interface DataWriter
- Throws:
IOException
writeBytes
public void writeBytes(long position,
byte[] bytes)
throws IOException
- Throws:
IOException
position
public long position()
throws IOException
- Specified by:
position
in interface DataWriter
- Throws:
IOException
position
public void position(long newPosition)
throws IOException
- Specified by:
position
in interface DataWriter
- Throws:
IOException
Copyright © 2011. All Rights Reserved.