Package totalcross.io
Class PDBStream
- java.lang.Object
-
- totalcross.io.Stream
-
- totalcross.io.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 Summary
Fields Modifier and Type Field Description protected PDBFilepdbprotected intrecSize-
Fields inherited from class totalcross.io.Stream
skipBuffer
-
-
Constructor Summary
Constructors Constructor Description PDBStream(java.lang.String name)Constructs a new PDBStream opening a PDB with the given name in READ_WRITE mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the underlying PDBFile.intreadBytes(byte[] buf, int start, int count)Reads bytes from the stream.intwriteBytes(byte[] buf, int start, int count)Always throws IOException; not implemented.-
Methods inherited from class totalcross.io.Stream
asInputStream, asOutputStream, asStream, asStream, skipBytes, wrapInputStream, wrapInputStreamToStream, write, writeBytes, writeBytes, writeBytes
-
-
-
-
Field Detail
-
recSize
protected int recSize
-
pdb
protected PDBFile pdb
-
-
Constructor Detail
-
PDBStream
public PDBStream(java.lang.String name) throws IllegalArgumentIOException, FileNotFoundException, IOExceptionConstructs a new PDBStream opening a PDB with the given name in READ_WRITE mode.- Parameters:
name- The pdb name of the file to open in the format Name.CRTR.TYPE.- Throws:
IllegalArgumentIOExceptionFileNotFoundExceptionIOException
-
-
Method Detail
-
writeBytes
public int writeBytes(byte[] buf, int start, int count) throws IOExceptionAlways throws IOException; not implemented.- Specified by:
writeBytesin classStream- Parameters:
buf- the byte array to write data fromstart- the start position in the byte arraycount- the number of bytes to write- Returns:
- the number of bytes actually written
- Throws:
IOException
-
close
public void close() throws IOExceptionCloses the underlying PDBFile.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
IOException- If an I/O error occurs.
-
readBytes
public int readBytes(byte[] buf, int start, int count) throws IOExceptionDescription copied from class:StreamReads 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:
readBytesin classStream- Parameters:
buf- the byte array to read data intostart- the start position in the arraycount- the number of bytes to read- Throws:
IOException
-
-