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 void
close()
Close the filelong
getFilePointer()
Current position in filelong
length()
Get the current file lengthint
read()
Read a single byte from the current positionint
read(byte[] b)
Read into buffer from current positionint
read(byte[] b, int off, int len)
Read into buffer from current positionvoid
seek(long pos)
Seek to new positionvoid
setLength(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 SmbException
Close the file- Specified by:
close
in 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 SmbException
Read 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 SmbException
Get the current file length- Returns:
- file length
- Throws:
SmbException
-
setLength
void setLength(long newLength) throws SmbException
Expand/truncate file length- Parameters:
newLength
- new file length- Throws:
SmbException
-
-