Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public abstract class AbstractPersistentBuffer extends Object implements PersistentBuffer
PersistentBuffer in terms of
basic read/write methods. This class is not thread safe.| Modifier and Type | Field and Description |
|---|---|
protected ProtectionLevel |
protectionLevel |
| Constructor and Description |
|---|
AbstractPersistentBuffer(ProtectionLevel protectionLevel) |
| Modifier and Type | Method and Description |
|---|---|
byte |
get(long position)
Implemented as call to
get(long,byte[],int,int). |
void |
get(long position,
byte[] buff,
int off,
int len)
Implemented as calls to
getSome(long,byte[],int,int) |
boolean |
getBoolean(long position)
Implemented as call to
readByte(long) |
InputStream |
getInputStream(long position,
long length)
Implemented as calls to
get(long) and getSome(long,byte[],int,int) |
int |
getInt(long position)
Implemented as call to
get(long,byte[],int,int) |
long |
getLong(long position)
Implemented as call to
get(long,byte[],int,int) |
OutputStream |
getOutputStream(long position,
long length)
Implemented as calls to
put(long,byte)
and put(long,byte[],int,int). |
ProtectionLevel |
getProtectionLevel()
Gets the protection level currently enforced by the buffer.
|
void |
put(long position,
byte value)
Implemented as call to
put(long,byte[],int,int). |
void |
putInt(long position,
int value)
Implemented as call to
write(long,byte[],int,int) |
void |
putLong(long position,
long value)
Implemented as call to
write(long,byte[],int,int) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbarrier, capacity, close, ensureZeros, getSome, isClosed, put, setCapacityprotected final ProtectionLevel protectionLevel
public AbstractPersistentBuffer(ProtectionLevel protectionLevel)
public ProtectionLevel getProtectionLevel()
PersistentBuffergetProtectionLevel in interface PersistentBufferPersistentBuffer.barrier(boolean)public void get(long position,
byte[] buff,
int off,
int len)
throws IOException
getSome(long,byte[],int,int)get in interface PersistentBufferIOException#read(long, byte[], int, int)public boolean getBoolean(long position)
throws IOException
readByte(long)getBoolean in interface PersistentBufferIOException#readByte(long)public byte get(long position)
throws IOException
get(long,byte[],int,int). For performance
reasons, it is strongly recommended to provide a more efficient implementation
of this method.get in interface PersistentBufferIOExceptionget(long, byte[], int, int)public int getInt(long position)
throws IOException
get(long,byte[],int,int)getInt in interface PersistentBufferIOExceptionget(long, byte[], int, int)public long getLong(long position)
throws IOException
get(long,byte[],int,int)getLong in interface PersistentBufferIOExceptionget(long, byte[], int, int)public void put(long position,
byte value)
throws IOException
put(long,byte[],int,int). For performance
reasons, it is strongly recommended to provide a more efficient implementation
of this method.put in interface PersistentBufferIOExceptionPersistentBuffer.put(long, byte[], int, int)public void putInt(long position,
int value)
throws IOException
write(long,byte[],int,int)putInt in interface PersistentBufferIOException#write(long, byte[], int, int)public void putLong(long position,
long value)
throws IOException
write(long,byte[],int,int)putLong in interface PersistentBufferIOException#write(long, byte[], int, int)public InputStream getInputStream(long position, long length) throws IOException, BufferUnderflowException
get(long) and getSome(long,byte[],int,int)getInputStream in interface PersistentBufferBufferUnderflowExceptionIOExceptionget(long),
PersistentBuffer.getSome(long, byte[], int, int)public OutputStream getOutputStream(long position, long length) throws IOException, BufferOverflowException
put(long,byte)
and put(long,byte[],int,int).getOutputStream in interface PersistentBufferBufferOverflowExceptionIOExceptionput(long, byte),
PersistentBuffer.put(long, byte[], int, int)Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.