John W. Campbell and Ricardo Leal
This class provides a positionable file stream using re-opens and skips
as needed. The filename may refer to a local file or may be a URL. It
may be useful in some instances where random access cannot be used as
the file may be accessed across the Web. However it is only likely to
be effective if the number of different file positionings required is
small and if the file being accessed is also fairly small. On each
re-positioning of the file, a new buffered input stream will be returned.
This version incorporates modifications by Ricardo Leal
(ricardo.leal@esrf.fr) to reduce the number of connections made and to
enable the transfer of 'gzipped' files.
Class, constructor and methods:
Class Details
Accessible Fields
Constructor
Methods
- Package:
- Jdl.JdlLib;
- Class name:
- JdlPositionableFile
- Class definition:
- public class JdlPositionableFile
- Extends:
- Object
- Implements:
- none
- Actions:
- none
No fields with public, package or protected access defined.
A single constructor is available.
Constructor:
Standard constructor
Constructs a JdlPositionableFile object.
- Constructor Definition:
- public JdlPositionableFile(String filnam) throws MalformedURLException
- Parameters List:
- filnam
- The file or URL name (URL identified by starting with http: or
file: or ftp:)
A single method opens a buffered input stream for the file with the
file set at the required position.
Methods:
Get buffered stream - getBufferedInputStream
Get a buffered input stream for the file opened for read at the
specified position.
- Method Definition:
- public BufferedInputStream getBufferedInputStream(long pos) throws FileNotFoundException, IOException, SecurityException
- Parameters List:
- pos
- The required file position offset from the start.
- Method Return:
-
The required buffered input stream (null if the file was not opened).
⇑ Up 2
⇑ Up 1
⇑ Top of this