/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class is a pointer to a binary array either in memory or on disk.
*
* @author Karl Helgason
*/
public final class ModelByteBuffer {
private long fileoffset;
private byte[] buffer;
private long offset;
private final long len;
private long left;
}
return (int)left;
}
try {
} catch (IOException e) {
//e.printStackTrace();
}
}
public boolean markSupported() {
return true;
}
}
if( n < 0)
return 0;
if (n > left)
n = left;
long p = raf.getFilePointer();
left -= n;
return n;
}
if (left == 0)
return -1;
if (len == -1)
return -1;
return len;
}
if (left == 0)
return -1;
if (len == -1)
return -1;
return len;
}
if (left == 0)
return -1;
if (b == -1)
return -1;
left--;
return b;
}
}
}
this.offset = 0;
if (beginIndex < 0)
beginIndex = 0;
if (beginIndex > parent_len)
if (endIndex < 0)
endIndex = 0;
if (endIndex > parent_len)
if (beginIndex > endIndex)
offset = beginIndex;
if (independent) {
offset = 0;
} else
offset = arrayOffset();
root = this;
}
}
this.offset = 0;
}
}
this.fileoffset = 0;
}
this.fileoffset = offset;
}
byte[] buff = new byte[1024];
int ret;
} else
}
try {
return new RandomFileInputStream();
} catch (IOException e) {
//e.printStackTrace();
return null;
}
}
return new ByteArrayInputStream(array(),
(int)arrayOffset(), (int)capacity());
}
}
}
boolean independent) {
}
public byte[] array() {
}
public long arrayOffset() {
if (root != this)
return offset;
}
public long capacity() {
return len;
}
return root;
}
return file;
}
public long getFilePointer() {
return fileoffset;
}
throws IOException {
try {
continue;
continue;
}
}
int read = 0;
read += 65536;
} else {
}
}
}
} finally {
}
}
if (root != this) {
return;
}
return;
throw new IllegalStateException(
"No file associated with this ByteBuffer!");
}
offset = 0;
}
public void unload() {
if (root != this) {
return;
}
throw new IllegalStateException(
"No file associated with this ByteBuffer!");
}
}
}