2.4.4 - Positionable File - JdlPositionableFile

John W. Campbell and Ricardo Leal Introduction

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
Methods Class Details

Class name:
Class definition:
public class JdlPositionableFile
none Accessible Fields

No fields with public, package or protected access defined. Constructor Introduction

A single constructor is available.


Standard constructor Standard constructor

Constructs a JdlPositionableFile object.

Constructor Definition:
public JdlPositionableFile(String filnam) throws MalformedURLException
Parameters List:
The file or URL name (URL identified by starting with http: or file: or ftp:) Methods Introduction

A single method opens a buffered input stream for the file with the file set at the required position.


Get buffered stream - getBufferedInputStream 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:
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