- All Superinterfaces:
AutoCloseable,DataInput,DataOutput
- All Known Implementing Classes:
SmbRandomAccessFile
File access that exposes random access semantics
- Author:
- mbechler
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the filelongCurrent position in filelonglength()Get the current file lengthintread()Read a single byte from the current positionintread(byte[] b) Read into buffer from current positionintread(byte[] b, int off, int len) Read into buffer from current positionvoidseek(long pos) Seek to new positionvoidsetLength(long newLength) Expand/truncate file lengthMethods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytesMethods inherited from interface java.io.DataOutput
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Method Details
-
close
Close the file- Specified by:
closein interfaceAutoCloseable- Throws:
SmbException- if an I/O error occurs during close
-
read
Read a single byte from the current position- Returns:
- read byte, -1 if EOF
- Throws:
SmbException- if an I/O error occurs during read
-
read
Read into buffer from current position- Parameters:
b- buffer- Returns:
- number of bytes read
- Throws:
SmbException- if an I/O error occurs during read
-
read
Read into buffer from current position- Parameters:
b- bufferoff- offset into bufferlen- read up tolenbytes- Returns:
- number of bytes read
- Throws:
SmbException- if an I/O error occurs during read
-
getFilePointer
long getFilePointer()Current position in file- Returns:
- current position
-
seek
void seek(long pos) Seek to new position- Parameters:
pos- the new position to seek to
-
length
Get the current file length- Returns:
- file length
- Throws:
SmbException- if an I/O error occurs
-
setLength
Expand/truncate file length- Parameters:
newLength- new file length- Throws:
SmbException- if an I/O error occurs
-