站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

DataAccessor (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor.ext
Interface DataAccessor

All Known Implementing Classes:
FileAccessor

public interface DataAccessor

DataAccessor for Code Completion DB files


Method Summary
 void append(byte[] buffer, int off, int len)
          Appends exactly len bytes, starting at off of the buffer pointer to the end of file resource.
 void close()
          Closes DataAccessor file resource
 int getFileLength()
           
 long getFilePointer()
          Returns the current offset in this file.
 void open(boolean requestWrite)
          Opens DataAccessor file resource
 void read(byte[] buffer, int off, int len)
          Reads up to len bytes of data from this file resource into an array of bytes.
 void resetFile()
          Clears the file and sets the offset to 0
 void seek(long pos)
          Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.
 

Method Detail

open

void open(boolean requestWrite)
          throws IOException
Opens DataAccessor file resource

Parameters:
requestWrite - if true, file is opened for read/write operation.
Throws:
IOException

close

void close()
           throws IOException
Closes DataAccessor file resource

Throws:
IOException

read

void read(byte[] buffer,
          int off,
          int len)
          throws IOException
Reads up to len bytes of data from this file resource into an array of bytes.

Parameters:
buffer - the buffer into which the data is read.
off - the start offset of the data.
len - the maximum number of bytes read.
Throws:
IOException

append

void append(byte[] buffer,
            int off,
            int len)
            throws IOException
Appends exactly len bytes, starting at off of the buffer pointer to the end of file resource.

Parameters:
buffer - the buffer from which the data is appended.
off - the start offset of the data in the buffer.
len - the number of bytes to append.
Throws:
IOException

getFilePointer

long getFilePointer()
                    throws IOException
Returns the current offset in this file.

Returns:
the offset from the beginning of the file, in bytes, at which the next read or write occurs.
Throws:
IOException

resetFile

void resetFile()
               throws IOException
Clears the file and sets the offset to 0

Throws:
IOException

seek

void seek(long pos)
          throws IOException
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.

Throws:
IOException

getFileLength

int getFileLength()

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.