public class CircularByteBuffer
extends java.lang.Object
Constructor and Description |
---|
CircularByteBuffer() |
CircularByteBuffer(int capacity) |
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns the number of bytes available and can be get without additional puts.
|
int |
capacity()
The capacity (size) is the maximum of bytes that can be stored inside this buffer.
|
void |
clear()
Clears all data from the buffer.
|
int |
free()
Returns the number of free bytes available that can still be put without additional gets.
|
int |
get()
Gets a single byte return or -1 if no data is available.
|
int |
get(byte[] dst)
Gets as many of the requested bytes as available from this buffer.
|
int |
get(byte[] dst,
int off,
int len)
Gets as many of the requested bytes as available from this buffer.
|
int |
peek()
Return the first byte a get would return or -1 if no data is available.
|
boolean |
put(byte value)
Puts a single byte if the buffer is not yet full.
|
int |
put(byte[] src)
Puts as many of the given bytes as possible into this buffer.
|
int |
put(byte[] src,
int off,
int len)
Puts as many of the given bytes as possible into this buffer.
|
int |
skip(int count)
Skips the given count of bytes, but at most the currently available count.
|
public CircularByteBuffer()
public CircularByteBuffer(int capacity)
public void clear()
public int get()
public int get(byte[] dst)
public int get(byte[] dst, int off, int len)
public boolean put(byte value)
public int put(byte[] src)
public int put(byte[] src, int off, int len)
public int peek()
public int skip(int count)
public int capacity()
public int available()
public int free()
Available under the Apache License, Version 2.0 - Copyright © 2012-2016 greenrobot.org. All Rights Reserved.