Package jcifs
Interface SmbRandomAccess
-
- All Superinterfaces:
AutoCloseable,DataInput,DataOutput
- All Known Implementing Classes:
SmbRandomAccessFile
public interface SmbRandomAccess extends DataOutput, DataInput, AutoCloseable
File access that exposes random access semantics- Author:
- mbechler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close the filelonggetFilePointer()Current 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 length-
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
-
Methods inherited from interface java.io.DataOutput
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
-
-
-
Method Detail
-
close
void close() throws SmbExceptionClose the file- Specified by:
closein interfaceAutoCloseable- Throws:
SmbException
-
read
int read() throws SmbException
Read a single byte from the current position- Returns:
- read byte, -1 if EOF
- Throws:
SmbException
-
read
int read(byte[] b) throws SmbException
Read into buffer from current position- Parameters:
b- buffer- Returns:
- number of bytes read
- Throws:
SmbException
-
read
int read(byte[] b, int off, int len) throws SmbExceptionRead into buffer from current position- Parameters:
b- bufferoff- offset into bufferlen- read up to len bytes- Returns:
- number of bytes read
- Throws:
SmbException
-
getFilePointer
long getFilePointer()
Current position in file- Returns:
- current position
-
seek
void seek(long pos)
Seek to new position- Parameters:
pos-
-
length
long length() throws SmbExceptionGet the current file length- Returns:
- file length
- Throws:
SmbException
-
setLength
void setLength(long newLength) throws SmbExceptionExpand/truncate file length- Parameters:
newLength- new file length- Throws:
SmbException
-
-