2.4.4 - Positionable File - JdlPositionableFile

John W. Campbell and Ricardo Leal

2.4.4.1 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
Constructor
Methods

2.4.4.2 Class Details

Package:
Jdl.JdlLib;
Class name:
JdlPositionableFile
Class definition:
public class JdlPositionableFile
Extends:
Object
Implements:
none
Actions:
none

2.4.4.3 Accessible Fields

No fields with public, package or protected access defined.

2.4.4.4 Constructor

2.4.4.4.1 Introduction

A single constructor is available.

Constructor:

Standard constructor

2.4.4.4.2 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:)

2.4.4.5 Methods

2.4.4.5.1 Introduction

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

Methods:

Get buffered stream - getBufferedInputStream

2.4.4.5.2 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