1 |
package manta.runtime; |
package gnu.java.nio; |
2 |
import java.nio.*; |
import java.nio.*; |
3 |
final public class MappedLongFileBuffer |
final public class MappedLongFileBuffer |
4 |
extends LongBuffer |
extends LongBuffer |
5 |
{ |
{ |
6 |
|
public long address; |
7 |
boolean ro; |
boolean ro; |
8 |
boolean direct; |
boolean direct; |
9 |
FileChannelImpl ch; |
public FileChannelImpl ch; |
10 |
MappedLongFileBuffer(FileChannelImpl ch) |
public MappedLongFileBuffer(FileChannelImpl ch) |
11 |
{ |
{ |
12 |
this.ch = ch; |
this.ch = ch; |
13 |
|
address = ch.address; |
14 |
} |
} |
15 |
MappedLongFileBuffer(MappedLongFileBuffer b) |
public MappedLongFileBuffer(MappedLongFileBuffer b) |
16 |
{ |
{ |
17 |
this.ro = b.ro; |
this.ro = b.ro; |
18 |
this.ch = b.ch; |
this.ch = b.ch; |
19 |
|
address = b.address; |
20 |
} |
} |
21 |
boolean isReadOnly() |
public boolean isReadOnly() |
22 |
{ |
{ |
23 |
return ro; |
return ro; |
24 |
} |
} |
25 |
public long get() |
final public long get() |
26 |
{ |
{ |
27 |
long a = MappedByteFileBuffer.nio_read_Long_file_channel(ch, pos); |
long a = MappedByteFileBuffer.nio_read_Long_file_channel(ch, position()); |
28 |
pos += 8; |
position(position() + 8); |
29 |
return a; |
return a; |
30 |
} |
} |
31 |
public LongBuffer put(long b) |
final public LongBuffer put(long b) |
32 |
{ |
{ |
33 |
MappedByteFileBuffer.nio_write_Long_file_channel(ch, pos, b); |
MappedByteFileBuffer.nio_write_Long_file_channel(ch, position(), b); |
34 |
pos += 8; |
position(position() + 8); |
35 |
return this; |
return this; |
36 |
} |
} |
37 |
public long get(int index) |
final public long get(int index) |
38 |
{ |
{ |
39 |
long a = MappedByteFileBuffer.nio_read_Long_file_channel(ch, index); |
long a = MappedByteFileBuffer.nio_read_Long_file_channel(ch, index); |
40 |
return a; |
return a; |
41 |
} |
} |
42 |
public LongBuffer put(int index, long b) |
final public LongBuffer put(int index, long b) |
43 |
{ |
{ |
44 |
MappedByteFileBuffer.nio_write_Long_file_channel(ch, index, b); |
MappedByteFileBuffer.nio_write_Long_file_channel(ch, index, b); |
45 |
return this; |
return this; |
46 |
} |
} |
47 |
public LongBuffer compact() |
final public LongBuffer compact() |
48 |
{ |
{ |
49 |
return this; |
return this; |
50 |
} |
} |
51 |
public boolean isDirect() |
final public boolean isDirect() |
52 |
{ |
{ |
53 |
return direct; |
return direct; |
54 |
} |
} |
55 |
public LongBuffer slice() |
final public LongBuffer slice() |
56 |
{ |
{ |
57 |
MappedLongFileBuffer A = new MappedLongFileBuffer(this); |
MappedLongFileBuffer A = new MappedLongFileBuffer(this); |
58 |
return A; |
return A; |
67 |
b.ro = true; |
b.ro = true; |
68 |
return b; |
return b; |
69 |
} |
} |
70 |
public ByteBuffer asByteBuffer() { return new MappedByteFileBuffer(ch); } public byte getByte() { byte a = MappedByteFileBuffer.nio_read_Byte_file_channel(ch, pos); pos += 8; return a; } public LongBuffer putByte(byte value) { MappedByteFileBuffer.nio_write_Byte_file_channel(ch, pos, value); pos += 8; return this; } public byte getByte(int index) { byte a = MappedByteFileBuffer.nio_read_Byte_file_channel(ch, index); return a; } public LongBuffer putByte(int index, byte value) { MappedByteFileBuffer.nio_write_Byte_file_channel(ch, index, value); return this; }; |
final public ByteBuffer asByteBuffer() { return new MappedByteFileBuffer(ch); } final public byte getByte() { byte a = MappedByteFileBuffer.nio_read_Byte_file_channel(ch, position()); position(position() + 8); return a; } final public LongBuffer putByte(byte value) { MappedByteFileBuffer.nio_write_Byte_file_channel(ch, position(), value); position(position() + 8); return this; } final public byte getByte(int index) { byte a = MappedByteFileBuffer.nio_read_Byte_file_channel(ch, index); return a; } final public LongBuffer putByte(int index, byte value) { MappedByteFileBuffer.nio_write_Byte_file_channel(ch, index, value); return this; }; |
71 |
public CharBuffer asCharBuffer() { return new MappedCharFileBuffer(ch); } public char getChar() { char a = MappedByteFileBuffer.nio_read_Char_file_channel(ch, pos); pos += 8; return a; } public LongBuffer putChar(char value) { MappedByteFileBuffer.nio_write_Char_file_channel(ch, pos, value); pos += 8; return this; } public char getChar(int index) { char a = MappedByteFileBuffer.nio_read_Char_file_channel(ch, index); return a; } public LongBuffer putChar(int index, char value) { MappedByteFileBuffer.nio_write_Char_file_channel(ch, index, value); return this; }; |
final public CharBuffer asCharBuffer() { return new MappedCharFileBuffer(ch); } final public char getChar() { char a = MappedByteFileBuffer.nio_read_Char_file_channel(ch, position()); position(position() + 8); return a; } final public LongBuffer putChar(char value) { MappedByteFileBuffer.nio_write_Char_file_channel(ch, position(), value); position(position() + 8); return this; } final public char getChar(int index) { char a = MappedByteFileBuffer.nio_read_Char_file_channel(ch, index); return a; } final public LongBuffer putChar(int index, char value) { MappedByteFileBuffer.nio_write_Char_file_channel(ch, index, value); return this; }; |
72 |
public ShortBuffer asShortBuffer() { return new MappedShortFileBuffer(ch); } public short getShort() { short a = MappedByteFileBuffer.nio_read_Short_file_channel(ch, pos); pos += 8; return a; } public LongBuffer putShort(short value) { MappedByteFileBuffer.nio_write_Short_file_channel(ch, pos, value); pos += 8; return this; } public short getShort(int index) { short a = MappedByteFileBuffer.nio_read_Short_file_channel(ch, index); return a; } public LongBuffer putShort(int index, short value) { MappedByteFileBuffer.nio_write_Short_file_channel(ch, index, value); return this; }; |
final public ShortBuffer asShortBuffer() { return new MappedShortFileBuffer(ch); } final public short getShort() { short a = MappedByteFileBuffer.nio_read_Short_file_channel(ch, position()); position(position() + 8); return a; } final public LongBuffer putShort(short value) { MappedByteFileBuffer.nio_write_Short_file_channel(ch, position(), value); position(position() + 8); return this; } final public short getShort(int index) { short a = MappedByteFileBuffer.nio_read_Short_file_channel(ch, index); return a; } final public LongBuffer putShort(int index, short value) { MappedByteFileBuffer.nio_write_Short_file_channel(ch, index, value); return this; }; |
73 |
public IntBuffer asIntBuffer() { return new MappedIntFileBuffer(ch); } public int getInt() { int a = MappedByteFileBuffer.nio_read_Int_file_channel(ch, pos); pos += 8; return a; } public LongBuffer putInt(int value) { MappedByteFileBuffer.nio_write_Int_file_channel(ch, pos, value); pos += 8; return this; } public int getInt(int index) { int a = MappedByteFileBuffer.nio_read_Int_file_channel(ch, index); return a; } public LongBuffer putInt(int index, int value) { MappedByteFileBuffer.nio_write_Int_file_channel(ch, index, value); return this; }; |
final public IntBuffer asIntBuffer() { return new MappedIntFileBuffer(ch); } final public int getInt() { int a = MappedByteFileBuffer.nio_read_Int_file_channel(ch, position()); position(position() + 8); return a; } final public LongBuffer putInt(int value) { MappedByteFileBuffer.nio_write_Int_file_channel(ch, position(), value); position(position() + 8); return this; } final public int getInt(int index) { int a = MappedByteFileBuffer.nio_read_Int_file_channel(ch, index); return a; } final public LongBuffer putInt(int index, int value) { MappedByteFileBuffer.nio_write_Int_file_channel(ch, index, value); return this; }; |
74 |
public LongBuffer asLongBuffer() { return new MappedLongFileBuffer(ch); } public long getLong() { long a = MappedByteFileBuffer.nio_read_Long_file_channel(ch, pos); pos += 8; return a; } public LongBuffer putLong(long value) { MappedByteFileBuffer.nio_write_Long_file_channel(ch, pos, value); pos += 8; return this; } public long getLong(int index) { long a = MappedByteFileBuffer.nio_read_Long_file_channel(ch, index); return a; } public LongBuffer putLong(int index, long value) { MappedByteFileBuffer.nio_write_Long_file_channel(ch, index, value); return this; }; |
final public LongBuffer asLongBuffer() { return new MappedLongFileBuffer(ch); } final public long getLong() { long a = MappedByteFileBuffer.nio_read_Long_file_channel(ch, position()); position(position() + 8); return a; } final public LongBuffer putLong(long value) { MappedByteFileBuffer.nio_write_Long_file_channel(ch, position(), value); position(position() + 8); return this; } final public long getLong(int index) { long a = MappedByteFileBuffer.nio_read_Long_file_channel(ch, index); return a; } final public LongBuffer putLong(int index, long value) { MappedByteFileBuffer.nio_write_Long_file_channel(ch, index, value); return this; }; |
75 |
public FloatBuffer asFloatBuffer() { return new MappedFloatFileBuffer(ch); } public float getFloat() { float a = MappedByteFileBuffer.nio_read_Float_file_channel(ch, pos); pos += 8; return a; } public LongBuffer putFloat(float value) { MappedByteFileBuffer.nio_write_Float_file_channel(ch, pos, value); pos += 8; return this; } public float getFloat(int index) { float a = MappedByteFileBuffer.nio_read_Float_file_channel(ch, index); return a; } public LongBuffer putFloat(int index, float value) { MappedByteFileBuffer.nio_write_Float_file_channel(ch, index, value); return this; }; |
final public FloatBuffer asFloatBuffer() { return new MappedFloatFileBuffer(ch); } final public float getFloat() { float a = MappedByteFileBuffer.nio_read_Float_file_channel(ch, position()); position(position() + 8); return a; } final public LongBuffer putFloat(float value) { MappedByteFileBuffer.nio_write_Float_file_channel(ch, position(), value); position(position() + 8); return this; } final public float getFloat(int index) { float a = MappedByteFileBuffer.nio_read_Float_file_channel(ch, index); return a; } final public LongBuffer putFloat(int index, float value) { MappedByteFileBuffer.nio_write_Float_file_channel(ch, index, value); return this; }; |
76 |
public DoubleBuffer asDoubleBuffer() { return new MappedDoubleFileBuffer(ch); } public double getDouble() { double a = MappedByteFileBuffer.nio_read_Double_file_channel(ch, pos); pos += 8; return a; } public LongBuffer putDouble(double value) { MappedByteFileBuffer.nio_write_Double_file_channel(ch, pos, value); pos += 8; return this; } public double getDouble(int index) { double a = MappedByteFileBuffer.nio_read_Double_file_channel(ch, index); return a; } public LongBuffer putDouble(int index, double value) { MappedByteFileBuffer.nio_write_Double_file_channel(ch, index, value); return this; }; |
final public DoubleBuffer asDoubleBuffer() { return new MappedDoubleFileBuffer(ch); } final public double getDouble() { double a = MappedByteFileBuffer.nio_read_Double_file_channel(ch, position()); position(position() + 8); return a; } final public LongBuffer putDouble(double value) { MappedByteFileBuffer.nio_write_Double_file_channel(ch, position(), value); position(position() + 8); return this; } final public double getDouble(int index) { double a = MappedByteFileBuffer.nio_read_Double_file_channel(ch, index); return a; } final public LongBuffer putDouble(int index, double value) { MappedByteFileBuffer.nio_write_Double_file_channel(ch, index, value); return this; }; |
77 |
} |
} |