public class DataChannel extends Object
Constructor and Description |
---|
DataChannel(Channel channel,
ByteOrder order) |
Modifier and Type | Method and Description |
---|---|
boolean |
readBoolean()
Reads boolean.
|
double |
readDouble(Representation representation)
Reads double value.
|
long |
readFixedLong(Representation representation)
Reads fixed size long.
|
String |
readString(int nBytes,
String encoding)
Reads a string for the specified number of bytes.
|
void |
writeBoolean(boolean value)
Writes boolean.
|
void |
writeDouble(double value,
Representation representation)
Writes double value.
|
void |
writeFixedLong(long value,
Representation representation)
Writes fixed size long value.
|
void |
writeString(String content,
String encoding)
Writes a given string.
|
public void writeFixedLong(long value, Representation representation) throws IOException
value
- the value of the long which should be written.representation
- the size of the long in bits.IOException
- during i/o error.public long readFixedLong(Representation representation) throws IOException
representation
- size of the long in bits.IOException
- during i/o error.public void writeDouble(double value, Representation representation) throws IOException
value
- value which should be written.representation
- the size of the double in bits.IOException
- during i/o error.public double readDouble(Representation representation) throws IOException
representation
- the size of the double value which should be read.IOException
- during i/o error.public void writeBoolean(boolean value) throws IOException
value
- the value of the boolean which should be written.IOException
- during i/o error.public boolean readBoolean() throws IOException
IOException
- during i/o error.public void writeString(String content, String encoding) throws IOException
content
- content which should be written.encoding
- the char-set encoding if the content.IOException
- during i/o error.public String readString(int nBytes, String encoding) throws IOException
nBytes
- number of bytes representing the string.encoding
- encoding which should be used to represent the string.IOException
- during i/o error.Copyright © 2018 WSO2. All rights reserved.