public class SmbRandomAccessFile extends Object implements SmbRandomAccess
| Constructor and Description |
|---|
SmbRandomAccessFile(SmbFile file,
String mode)
Instantiate a random access file from a
SmbFile |
SmbRandomAccessFile(String url,
String mode,
int sharing,
CIFSContext tc)
Instantiate a random access file from URL
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the file
|
long |
getFilePointer()
Current position in file
|
long |
length()
Get the current file length
|
int |
read()
Read a single byte from the current position
|
int |
read(byte[] b)
Read into buffer from current position
|
int |
read(byte[] b,
int off,
int len)
Read into buffer from current position
|
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
void |
seek(long pos)
Seek to new position
|
void |
setLength(long newLength)
Expand/truncate file length
|
int |
skipBytes(int n) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeBoolean(boolean v) |
void |
writeByte(int v) |
void |
writeBytes(String s) |
void |
writeChar(int v) |
void |
writeChars(String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(String str) |
public SmbRandomAccessFile(String url, String mode, int sharing, CIFSContext tc) throws SmbException, MalformedURLException
url - mode - sharing - tc - SmbExceptionMalformedURLExceptionpublic SmbRandomAccessFile(SmbFile file, String mode) throws SmbException
SmbFilefile - mode - SmbExceptionpublic void close()
throws SmbException
SmbRandomAccessclose in interface AutoCloseableclose in interface SmbRandomAccessSmbExceptionpublic int read()
throws SmbException
SmbRandomAccessread in interface SmbRandomAccessSmbExceptionpublic int read(byte[] b)
throws SmbException
SmbRandomAccessread in interface SmbRandomAccessb - bufferSmbExceptionpublic int read(byte[] b,
int off,
int len)
throws SmbException
SmbRandomAccessread in interface SmbRandomAccessb - bufferoff - offset into bufferlen - read up to len bytesSmbExceptionpublic final void readFully(byte[] b)
throws SmbException
readFully in interface DataInputSmbExceptionpublic final void readFully(byte[] b,
int off,
int len)
throws SmbException
readFully in interface DataInputSmbExceptionpublic int skipBytes(int n)
throws SmbException
skipBytes in interface DataInputSmbExceptionpublic void write(int b)
throws SmbException
write in interface DataOutputSmbExceptionpublic void write(byte[] b)
throws SmbException
write in interface DataOutputSmbExceptionpublic void write(byte[] b,
int off,
int len)
throws SmbException
write in interface DataOutputSmbExceptionpublic long getFilePointer()
SmbRandomAccessgetFilePointer in interface SmbRandomAccesspublic void seek(long pos)
SmbRandomAccessseek in interface SmbRandomAccesspublic long length()
throws SmbException
SmbRandomAccesslength in interface SmbRandomAccessSmbExceptionpublic void setLength(long newLength)
throws SmbException
SmbRandomAccesssetLength in interface SmbRandomAccessnewLength - new file lengthSmbExceptionpublic final boolean readBoolean()
throws SmbException
readBoolean in interface DataInputSmbExceptionpublic final byte readByte()
throws SmbException
readByte in interface DataInputSmbExceptionpublic final int readUnsignedByte()
throws SmbException
readUnsignedByte in interface DataInputSmbExceptionpublic final short readShort()
throws SmbException
readShort in interface DataInputSmbExceptionpublic final int readUnsignedShort()
throws SmbException
readUnsignedShort in interface DataInputSmbExceptionpublic final char readChar()
throws SmbException
readChar in interface DataInputSmbExceptionpublic final int readInt()
throws SmbException
readInt in interface DataInputSmbExceptionpublic final long readLong()
throws SmbException
readLong in interface DataInputSmbExceptionpublic final float readFloat()
throws SmbException
readFloat in interface DataInputSmbExceptionpublic final double readDouble()
throws SmbException
readDouble in interface DataInputSmbExceptionpublic final String readLine() throws SmbException
readLine in interface DataInputSmbExceptionpublic final String readUTF() throws SmbException
readUTF in interface DataInputSmbExceptionpublic final void writeBoolean(boolean v)
throws SmbException
writeBoolean in interface DataOutputSmbExceptionpublic final void writeByte(int v)
throws SmbException
writeByte in interface DataOutputSmbExceptionpublic final void writeShort(int v)
throws SmbException
writeShort in interface DataOutputSmbExceptionpublic final void writeChar(int v)
throws SmbException
writeChar in interface DataOutputSmbExceptionpublic final void writeInt(int v)
throws SmbException
writeInt in interface DataOutputSmbExceptionpublic final void writeLong(long v)
throws SmbException
writeLong in interface DataOutputSmbExceptionpublic final void writeFloat(float v)
throws SmbException
writeFloat in interface DataOutputSmbExceptionpublic final void writeDouble(double v)
throws SmbException
writeDouble in interface DataOutputSmbExceptionpublic final void writeBytes(String s) throws SmbException
writeBytes in interface DataOutputSmbExceptionpublic final void writeChars(String s) throws SmbException
writeChars in interface DataOutputSmbExceptionpublic final void writeUTF(String str) throws SmbException
writeUTF in interface DataOutputSmbExceptionCopyright © 2018. All rights reserved.