|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
com.mucommander.io.RandomAccessOutputStream
com.mucommander.file.impl.nfs.NFSFile.NFSRandomAccessOutputStream
public static class NFSFile.NFSRandomAccessOutputStream
NFSRandomAccessOutputStream extends RandomAccessOutputStream to provide random write access to an NFSFile.
Warning: this RandomAccessOutputStream is not fully functional, the setLength(long) has a
limitation.
| Constructor Summary | |
|---|---|
NFSFile.NFSRandomAccessOutputStream(com.sun.xfile.XRandomAccessFile raf)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes this stream and releases any system resources associated with the stream. |
long |
getLength()
Returns the length of the file, in bytes. |
long |
getOffset()
Returns the offset (in bytes) from the beginning of the file at which the next read or write occurs. |
void |
seek(long offset)
Sets the offset, measured from the beginning of the file, at which the next read or write occurs. |
void |
setLength(long newLength)
Warning: this method is only capable of expanding the file, not truncating it. |
void |
write(byte[] b)
Writes b.length bytes from the specified byte array to this file, starting at the current file offset. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array starting at offset off to this file. |
void |
write(int i)
|
| Methods inherited from class java.io.OutputStream |
|---|
flush |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NFSFile.NFSRandomAccessOutputStream(com.sun.xfile.XRandomAccessFile raf)
| Method Detail |
|---|
public void write(int i)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(byte[] b)
throws java.io.IOException
RandomAccessOutputStreamb.length bytes from the specified byte array to this file, starting at the current file offset.
write in class RandomAccessOutputStreamb - the data to write
java.io.IOException - if an I/O error occurs
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
RandomAccessOutputStreamlen bytes from the specified byte array starting at offset off to this file.
write in class RandomAccessOutputStreamb - the data to writeoff - the start offset in the data arraylen - the number of bytes to write
java.io.IOException - if an I/O error occurs
public void close()
throws java.io.IOException
RandomAccessOutputStream
close in interface RandomAccessclose in interface java.io.Closeableclose in class RandomAccessOutputStreamjava.io.IOException - if an I/O error occurs.
public long getOffset()
throws java.io.IOException
RandomAccess
java.io.IOException - if an I/O error occurs.
public long getLength()
throws java.io.IOException
RandomAccess
java.io.IOException - if an I/O error occurs
public void seek(long offset)
throws java.io.IOException
RandomAccess
offset - the new offset position, measured in bytes from the beginning of the file
java.io.IOException - if an I/O error occurs
public void setLength(long newLength)
throws java.io.IOException
IOException whenever the newLength parameter is greater than
the current length reported by getLength().
setLength in class RandomAccessOutputStreamnewLength - the new file's length
java.io.IOException - If an I/O error occurred while trying to change the file's length
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard