svn-gvsig-desktop / branches / Mobile_Compatible_Hito_1 / libFMap_mobile_shp_driver / src-comp / org / gvsig / datasources / common / IBigByteBuffer.java @ 21865
History | View | Annotate | Download (1.76 KB)
1 |
package org.gvsig.datasources.common; |
---|---|
2 |
|
3 |
import java.io.IOException; |
4 |
import java.nio.ByteOrder; |
5 |
|
6 |
/**
|
7 |
* This inteface was created to permit the share of code between JSE and JME when accessing
|
8 |
* file data sources.
|
9 |
*
|
10 |
* Each Java versioon will have to implement these methods with the available packages.
|
11 |
*
|
12 |
* @author jldominguez
|
13 |
*
|
14 |
*/
|
15 |
public interface IBigByteBuffer { |
16 |
|
17 |
|
18 |
/**
|
19 |
* Moves file cursor to position p
|
20 |
* @param p the new position
|
21 |
* @throws IOException
|
22 |
*/
|
23 |
public void position(long p); |
24 |
|
25 |
/**
|
26 |
*
|
27 |
* @return current cursor position
|
28 |
*/
|
29 |
public int position(); |
30 |
|
31 |
/**
|
32 |
* @return byte pointed by cursor then increases cursor
|
33 |
*/
|
34 |
public byte get(); |
35 |
|
36 |
/**
|
37 |
* Gets one byte
|
38 |
* @param ind index of the byte of interest
|
39 |
* @return the byte of interest
|
40 |
*/
|
41 |
public byte getByte(int ind); |
42 |
|
43 |
/**
|
44 |
* @return integer pointed by cursor then increases cursor
|
45 |
*/
|
46 |
public int getInt(); |
47 |
|
48 |
/**
|
49 |
* @return short pointed by cursor then increases cursor
|
50 |
*/
|
51 |
public short getShort(); |
52 |
|
53 |
/**
|
54 |
* Gets the integer at a certain position
|
55 |
* @param index the index of interest
|
56 |
* @return the integer at a certain position
|
57 |
*/
|
58 |
public int getInt(int index); |
59 |
|
60 |
/**
|
61 |
* Gets some bytes.
|
62 |
* @param out the array of bytes to be filled
|
63 |
*/
|
64 |
public void get(byte[] out); |
65 |
|
66 |
/**
|
67 |
* @return double pointed by cursor then increases cursor
|
68 |
*/
|
69 |
public double getDouble(); |
70 |
|
71 |
/*
|
72 |
private int getInt(final byte[] data, final int offset);
|
73 |
|
74 |
private short getShort(final byte[] data, final int offset);
|
75 |
|
76 |
private long getNumber(final byte[] data, final int offset, final int size);
|
77 |
|
78 |
private double getDouble(final byte[] data, final int offset);
|
79 |
*/
|
80 |
|
81 |
/**
|
82 |
* Sets byte order (big endian, little endian)
|
83 |
* @param o byte order (big endian, little endian)
|
84 |
*/
|
85 |
public void order(ByteOrder o); |
86 |
|
87 |
} |