@Authors(value="Nikolche Mihajlovski") @Since(value="4.1.0") public class SynchronizedBuf extends OutputStream implements Buf
INCOMPLETE_READ| Constructor and Description |
|---|
SynchronizedBuf(Buf buf) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(byte value) |
void |
append(byte[] bytes) |
void |
append(byte[] bytes,
int offset,
int length) |
void |
append(ByteArrayOutputStream src) |
void |
append(ByteBuffer wrap) |
int |
append(ReadableByteChannel channel) |
int |
append(String s) |
OutputStream |
asOutputStream() |
String |
asText() |
void |
back(int count) |
ByteBuffer |
bufAt(int index) |
int |
bufCount() |
int |
bufferIndexOf(int position) |
int |
bufferOffsetOf(int position) |
Bytes |
bytes() |
int |
checkpoint() |
void |
checkpoint(int checkpoint) |
void |
clear() |
String |
data() |
void |
deleteAfter(int position) |
void |
deleteBefore(int position) |
void |
deleteLast(int count) |
ByteBuffer |
exposed() |
ByteBuffer |
first() |
String |
get(BufRange range) |
void |
get(BufRange range,
byte[] dest,
int offset) |
byte |
get(int position) |
long |
getN(BufRange range) |
ByteBuffer |
getSingle() |
boolean |
hasRemaining() |
boolean |
isSingle() |
int |
limit() |
void |
limit(int limit) |
byte |
next() |
byte |
peek() |
int |
position() |
void |
position(int position) |
void |
put(int position,
byte value) |
void |
put(int position,
byte[] bytes,
int offset,
int length) |
int |
putNumAsText(int position,
long num,
boolean forward) |
String |
readLn() |
String |
readN(int count) |
byte[] |
readNbytes(int count) |
int |
remaining() |
void |
scanLn(BufRange range) |
void |
scanLnLn(BufRanges ranges) |
void |
scanLnLn(BufRanges ranges,
org.rapidoid.wrap.IntWrap result,
byte end1,
byte end2) |
void |
scanN(int count,
BufRange range) |
void |
scanTo(byte sep,
BufRange range,
boolean failOnLimit) |
int |
scanTo(byte sep1,
byte sep2,
BufRange range,
boolean failOnLimit) |
void |
scanUntil(byte value,
BufRange range) |
void |
scanWhile(byte value,
BufRange range) |
void |
setReadOnly(boolean readOnly) |
int |
size() |
void |
skip(int count) |
int |
unitCount() |
int |
unitSize() |
Buf |
unwrap() |
void |
upto(byte value,
BufRange range) |
void |
write(byte[] src,
int off,
int len) |
void |
write(int byteValue) |
int |
writeTo(ByteBuffer buffer) |
int |
writeTo(ByteBuffer buffer,
int srcOffset,
int length) |
int |
writeTo(WritableByteChannel channel) |
int |
writeTo(WritableByteChannel channel,
int srcOffset,
int length) |
close, flush, writepublic SynchronizedBuf(Buf buf)
public void put(int position,
byte[] bytes,
int offset,
int length)
public void append(ByteBuffer wrap)
public int append(ReadableByteChannel channel) throws IOException
append in interface BufIOExceptionpublic void append(byte[] bytes,
int offset,
int length)
public int writeTo(WritableByteChannel channel) throws IOException
writeTo in interface BufIOExceptionpublic int writeTo(WritableByteChannel channel, int srcOffset, int length) throws IOException
writeTo in interface BufIOExceptionpublic int writeTo(ByteBuffer buffer)
public int writeTo(ByteBuffer buffer, int srcOffset, int length)
public void deleteBefore(int position)
deleteBefore in interface Bufpublic void deleteAfter(int position)
deleteAfter in interface Bufpublic void deleteLast(int count)
deleteLast in interface Bufpublic ByteBuffer getSingle()
public ByteBuffer first()
public int putNumAsText(int position,
long num,
boolean forward)
putNumAsText in interface Bufpublic boolean hasRemaining()
hasRemaining in interface Bufpublic ByteBuffer exposed()
public void scanUntil(byte value,
BufRange range)
public void scanWhile(byte value,
BufRange range)
public ByteBuffer bufAt(int index)
public int bufferIndexOf(int position)
bufferIndexOf in interface Bufpublic int bufferOffsetOf(int position)
bufferOffsetOf in interface Bufpublic byte[] readNbytes(int count)
readNbytes in interface Bufpublic void scanTo(byte sep,
BufRange range,
boolean failOnLimit)
public int scanTo(byte sep1,
byte sep2,
BufRange range,
boolean failOnLimit)
public void scanLnLn(BufRanges ranges, org.rapidoid.wrap.IntWrap result, byte end1, byte end2)
public void setReadOnly(boolean readOnly)
setReadOnly in interface Bufpublic int checkpoint()
checkpoint in interface Bufpublic void checkpoint(int checkpoint)
checkpoint in interface Bufpublic void write(int byteValue)
throws IOException
write in interface Bufwrite in class OutputStreamIOExceptionpublic void write(byte[] src,
int off,
int len)
throws IOException
write in interface Bufwrite in class OutputStreamIOExceptionpublic OutputStream asOutputStream()
asOutputStream in interface Bufpublic void append(ByteArrayOutputStream src)
Copyright © 2014–2017 Nikolche Mihajlovski and contributors. All rights reserved.