public class MemorySegment
extends java.lang.Object
Contains an in-memory copy of file data.
Constructor and Description |
---|
MemorySegment(byte[] buf,
int pos,
int len,
long fileOff)
Class constructor
|
MemorySegment(byte[] buf,
long fileOff)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsData(long fileOff,
int len)
Check if this segment contains the data for the specified request
|
void |
copyBytes(byte[] buf,
int pos,
int len,
long fileOff)
Copy data to the specified user buffer
|
protected void |
decrementReadCounter()
Decrement the read counter, if greater than zero
|
protected void |
decrementReadCounter(int decr)
Decrement the read counter, if greater than zero
|
byte[] |
getBuffer()
Return the buffer
|
long |
getFileOffset()
Return the file offset of the data
|
int |
getLength()
Return the buffer length
|
int |
getReadCounter()
Return the memory segment read count
|
void |
incrementReadCounter(int incr)
Increment the read counter by the specified amount
|
java.lang.String |
toString()
Return the memory segment as a string
|
public MemorySegment(byte[] buf, long fileOff)
buf
- byte[]fileOff
- longpublic MemorySegment(byte[] buf, int pos, int len, long fileOff)
buf
- byte[]pos
- intlen
- intfileOff
- longpublic final byte[] getBuffer()
public final int getLength()
public final long getFileOffset()
public final int getReadCounter()
public final boolean containsData(long fileOff, int len)
fileOff
- longlen
- intpublic final void copyBytes(byte[] buf, int pos, int len, long fileOff)
buf
- byte[]pos
- intlen
- intfileOff
- longpublic final void incrementReadCounter(int incr)
incr
- intprotected final void decrementReadCounter(int decr)
decr
- intprotected final void decrementReadCounter()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.