public class BufferChannelMem extends Object implements BufferChannel
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static BufferChannel |
create() |
static BufferChannel |
create(String name) |
BufferChannel |
duplicate()
Return another channel to the same storage but with independent position.
|
String |
getFilename()
Filename for this BufferChannel (maybe null)
|
String |
getLabel()
useful display string
|
boolean |
isEmpty()
Is it empty?
|
long |
position()
return the position
|
void |
position(long pos)
set the position
|
int |
read(ByteBuffer buffer)
Read into a ByteBuffer.
|
int |
read(ByteBuffer buffer,
long loc)
Read into a ByteBuffer, starting at position loc.
|
long |
size()
Length of storage, in bytes.
|
void |
sync() |
String |
toString() |
void |
truncate(long size)
Truncate the file.
|
int |
write(ByteBuffer buffer)
Write from ByteBuffer, starting at the current position.
|
int |
write(ByteBuffer buffer,
long loc)
Write from ByteBuffer, starting at position loc.
|
public static BufferChannel create()
public static BufferChannel create(String name)
public BufferChannel duplicate()
BufferChannelduplicate in interface BufferChannelpublic long position()
BufferChannelposition in interface BufferChannelpublic void position(long pos)
BufferChannelposition in interface BufferChannelpublic int read(ByteBuffer buffer)
BufferChannelread in interface BufferChannelpublic int read(ByteBuffer buffer, long loc)
BufferChannelread in interface BufferChannelpublic int write(ByteBuffer buffer)
BufferChannelwrite in interface BufferChannelpublic int write(ByteBuffer buffer, long loc)
BufferChannelwrite in interface BufferChannelpublic void truncate(long size)
BufferChanneltruncate in interface BufferChannelFileChannel.truncate(long)public long size()
BufferChannelsize in interface BufferChannelpublic boolean isEmpty()
BufferChannelisEmpty in interface BufferChannelpublic void sync()
sync in interface org.apache.jena.atlas.lib.Syncpublic void close()
close in interface org.apache.jena.atlas.lib.Closeablepublic String getLabel()
BufferChannelgetLabel in interface BufferChannelpublic String getFilename()
BufferChannelgetFilename in interface BufferChannelLicensed under the Apache License, Version 2.0