Package org.analogweb.core
Class DefaultReadableBuffer
- java.lang.Object
-
- org.analogweb.core.DefaultReadableBuffer
-
- All Implemented Interfaces:
ReadableBuffer
public class DefaultReadableBuffer extends Object implements ReadableBuffer
- Author:
- y2k2mt
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ReadableByteChannel
asChannel()
InputStream
asInputStream()
String
asString(Charset charset)
protected ReadableByteChannel
getChannel()
long
getLength()
ReadableBuffer
read(byte[] dst, int index, int length)
ReadableBuffer
read(ByteBuffer buffer)
static DefaultReadableBuffer
readBuffer(byte[] content)
static DefaultReadableBuffer
readBuffer(InputStream in)
static DefaultReadableBuffer
readBuffer(ReadableByteChannel content)
ReadableBuffer
to(WritableBuffer writable)
String
toString()
-
-
-
Method Detail
-
readBuffer
public static DefaultReadableBuffer readBuffer(byte[] content)
-
readBuffer
public static DefaultReadableBuffer readBuffer(InputStream in)
-
readBuffer
public static DefaultReadableBuffer readBuffer(ReadableByteChannel content)
-
getChannel
protected ReadableByteChannel getChannel()
-
read
public ReadableBuffer read(byte[] dst, int index, int length) throws IOException
- Specified by:
read
in interfaceReadableBuffer
- Throws:
IOException
-
read
public ReadableBuffer read(ByteBuffer buffer) throws IOException
- Specified by:
read
in interfaceReadableBuffer
- Throws:
IOException
-
asString
public String asString(Charset charset) throws IOException
- Specified by:
asString
in interfaceReadableBuffer
- Throws:
IOException
-
asInputStream
public InputStream asInputStream() throws IOException
- Specified by:
asInputStream
in interfaceReadableBuffer
- Throws:
IOException
-
asChannel
public ReadableByteChannel asChannel() throws IOException
- Specified by:
asChannel
in interfaceReadableBuffer
- Throws:
IOException
-
to
public ReadableBuffer to(WritableBuffer writable) throws IOException
- Specified by:
to
in interfaceReadableBuffer
- Throws:
IOException
-
getLength
public long getLength()
- Specified by:
getLength
in interfaceReadableBuffer
-
-