Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1)

E12063-03


oracle.dss.util.xdo.common.io
Class ByteArray

java.lang.Object
  extended by oracle.dss.util.xdo.common.io.ByteArray

All Implemented Interfaces:
RandomAccessFileOrMemory

public class ByteArray
extends java.lang.Object
implements RandomAccessFileOrMemory

Byte Array handling class. Using this class, you can access memory like RandomAccessFile.

Note)
Write methods are not implemented yet.


Field Summary
static java.lang.String RCS_ID
           

 

Constructor Summary
ByteArray(byte[] buf)
           

 

Method Summary
 void close()
          Close (Calling this method is optional for this class)
 long getFilePointer()
          Returns the position.
 long length()
          Returns the length of this byte array.
 int read()
          Read 1 byte
 int read(byte[] b)
          Reads up to b.length bytes of data from this file into an array of bytes.
 int read(byte[] b, int off, int len)
          Reads up to len bytes of data from this file into an array of bytes.
 void seek(long pos)
          Seek the position
 void setLength(long newLength)
          Set the file length or memory size.
 int skipBytes(int n)
          Attempts to skip over n bytes of input discarding the skipped bytes.
 void write(byte[] b)
          Writes b.length bytes from the specified byte array
 void write(byte[] b, int off, int len)
          Writes len bytes from the specified byte array.
 void write(int b)
          Writes the specified byte.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

Constructor Detail

ByteArray

public ByteArray(byte[] buf)

Method Detail

read

public int read()
         throws java.io.IOException
Read 1 byte
Specified by:
read in interface RandomAccessFileOrMemory
Returns:
the next byte of data, or -1 if the end of the file has been reached
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Reads up to b.length bytes of data from this file into an array of bytes. This method blocks until at least one byte of input is available.
Specified by:
read in interface RandomAccessFileOrMemory
Parameters:
buf -
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of this file has been reached
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Reads up to len bytes of data from this file into an array of bytes. This method blocks until at least one byte of input is available.
Specified by:
read in interface RandomAccessFileOrMemory
Parameters:
b - the buffer into which the data is read.
off - the start offset of the data.
len - the maximum number of bytes read.
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
Throws:
java.io.IOException

seek

public void seek(long pos)
          throws java.io.IOException
Seek the position
Specified by:
seek in interface RandomAccessFileOrMemory
Parameters:
pos -
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
Returns the position.
Specified by:
getFilePointer in interface RandomAccessFileOrMemory
Returns:

skipBytes

public int skipBytes(int n)
              throws java.io.IOException
Attempts to skip over n bytes of input discarding the skipped bytes.
Specified by:
skipBytes in interface RandomAccessFileOrMemory
Parameters:
n - the number of bytes to be skipped.
Returns:
the actual number of bytes skipped.
Throws:
java.io.IOException

length

public long length()
            throws java.io.IOException
Returns the length of this byte array.
Specified by:
length in interface RandomAccessFileOrMemory
Returns:
the length of this byte array, measured in bytes.
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close (Calling this method is optional for this class)
Specified by:
close in interface RandomAccessFileOrMemory
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Description copied from interface: RandomAccessFileOrMemory
Writes the specified byte.
Specified by:
write in interface RandomAccessFileOrMemory
Parameters:
b - the byte to be written.
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Description copied from interface: RandomAccessFileOrMemory
Writes b.length bytes from the specified byte array
Specified by:
write in interface RandomAccessFileOrMemory
Parameters:
b - the data.
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Description copied from interface: RandomAccessFileOrMemory
Writes len bytes from the specified byte array.
Specified by:
write in interface RandomAccessFileOrMemory
Parameters:
b - the data.
off - the start offset in the data.
len - the number of bytes to write.
Throws:
java.io.IOException

setLength

public void setLength(long newLength)
               throws java.io.IOException
Description copied from interface: RandomAccessFileOrMemory
Set the file length or memory size.
Specified by:
setLength in interface RandomAccessFileOrMemory
Throws:
java.io.IOException

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1)

E12063-03


Copyright © 1997, 2009, Oracle. All rights reserved.