Package totalcross.io

Class PDBStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class PDBStream
    extends Stream
    Used to make a PDBFile act as a single Stream, reading all records in sequence. Usually you use this to open a photo taken with the Palm's camera. Note that it does not support writings.
    • Field Detail

      • recSize

        protected int recSize
    • Method Detail

      • writeBytes

        public int writeBytes​(byte[] buf,
                              int start,
                              int count)
                       throws IOException
        Always throws IOException; not implemented.
        Specified by:
        writeBytes in class Stream
        Parameters:
        buf - the byte array to write data from
        start - the start position in the byte array
        count - the number of bytes to write
        Returns:
        the number of bytes actually written
        Throws:
        IOException
      • close

        public void close()
                   throws IOException
        Closes the underlying PDBFile.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        IOException - If an I/O error occurs.
      • readBytes

        public int readBytes​(byte[] buf,
                             int start,
                             int count)
                      throws IOException
        Description copied from class: Stream
        Reads bytes from the stream. Returns the number of bytes actually read or -1 if the end of the stream was reached. (if applicable to the stream)
        Specified by:
        readBytes in class Stream
        Parameters:
        buf - the byte array to read data into
        start - the start position in the array
        count - the number of bytes to read
        Throws:
        IOException