Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/neuron/jaffer/AFP_Fork.java


1   /* 
2    * Copyright (c) 2003 Stewart Allen <stewart@neuron.com>. All rights reserved.
3    * This program is free software. See the 'License' file for details.
4    */
5   
6   package com.neuron.jaffer;
7   
8   import java.io.*;
9   import java.net.*;
10  import java.util.*;
11  
12  public abstract class AFP_Fork extends Utility implements AFP_Constants
13  {
14    public final static int FORK_UNKNOWN  = 0x00;
15    public final static int FORK_DATA     = 0x01;
16    public final static int FORK_RESOURCE = 0x02;
17  
18    public boolean isData()
19    {
20      return getForkType() == FORK_DATA;
21    }
22  
23    public boolean isResource()
24    {
25      return getForkType() == FORK_RESOURCE;
26    }
27  
28    public abstract int getForkType()
29      ;
30  
31    public abstract void readRange(long offset, long length, ByteWriter ww)
32      throws IOException;
33  
34    // returns the number of bytes written
35    public abstract long writeRange(long offset, long length, ByteReader rr)
36      throws IOException;
37  
38    public abstract long getLength()
39      throws IOException;
40  
41    public abstract void setLength(long length)
42      throws IOException;
43  
44    public abstract void flush()
45      throws IOException;
46  
47    public abstract void close()
48      ;
49  }
50