Module 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 Details

    • close

      void close() throws SmbException
      Close the file
      Specified by:
      close in interface AutoCloseable
      Throws:
      SmbException - if an I/O error occurs during close
    • read

      int read() throws SmbException
      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

      int read(byte[] b) throws SmbException
      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

      int read(byte[] b, int off, int len) throws SmbException
      Read into buffer from current position
      Parameters:
      b - buffer
      off - offset into buffer
      len - read up to len bytes
      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

      long length() throws SmbException
      Get the current file length
      Returns:
      file length
      Throws:
      SmbException - if an I/O error occurs
    • setLength

      void setLength(long newLength) throws SmbException
      Expand/truncate file length
      Parameters:
      newLength - new file length
      Throws:
      SmbException - if an I/O error occurs