1 | /* |
2 | |
3 | Derby - Class org.apache.derby.impl.store.raw.log.LogAccessFileBuffer |
4 | |
5 | Copyright 2003, 2004 The Apache Software Foundation or its licensors, as applicable. |
6 | |
7 | Licensed under the Apache License, Version 2.0 (the "License"); |
8 | you may not use this file except in compliance with the License. |
9 | You may obtain a copy of the License at |
10 | |
11 | http://www.apache.org/licenses/LICENSE-2.0 |
12 | |
13 | Unless required by applicable law or agreed to in writing, software |
14 | distributed under the License is distributed on an "AS IS" BASIS, |
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | See the License for the specific language governing permissions and |
17 | limitations under the License. |
18 | |
19 | */ |
20 | |
21 | package org.apache.derby.impl.store.raw.log; |
22 | |
23 | |
24 | /** |
25 | |
26 | A single buffer of data. |
27 | |
28 | **/ |
29 | |
30 | final class LogAccessFileBuffer |
31 | { |
32 | |
33 | |
34 | /************************************************************************** |
35 | * Fields of the class |
36 | ************************************************************************** |
37 | */ |
38 | protected byte[] buffer; |
39 | protected int bytes_free; |
40 | protected int position; |
41 | protected int length; |
42 | |
43 | LogAccessFileBuffer next; |
44 | LogAccessFileBuffer prev; |
45 | |
46 | /************************************************************************** |
47 | * Constructors for This class: |
48 | ************************************************************************** |
49 | */ |
50 | public LogAccessFileBuffer( |
51 | int size) |
52 | { |
53 | buffer = new byte[size]; |
54 | prev = null; |
55 | next = null; |
56 | |
57 | init(0); |
58 | } |
59 | |
60 | /************************************************************************** |
61 | * Private/Protected methods of This class: |
62 | ************************************************************************** |
63 | */ |
64 | public void init(int reserve) |
65 | { |
66 | length = buffer.length - reserve; |
67 | bytes_free = length; |
68 | position = reserve; |
69 | } |
70 | |
71 | /************************************************************************** |
72 | * Public Methods of This class: |
73 | ************************************************************************** |
74 | */ |
75 | |
76 | /************************************************************************** |
77 | * Public Methods of XXXX class: |
78 | ************************************************************************** |
79 | */ |
80 | } |