public class DataOutput extends Object
Constructor and Description |
---|
DataOutput()
Constructor.
|
DataOutput(String encoding)
Constructor with a given encoding.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Returns the written data buffer as byte array.
|
void |
print(String string)
Write the given string to the buffer using the given encoding.
|
void |
println()
Add a newline to the given string.
|
void |
println(String string)
Write the given string to the buffer using the given encoding.
|
void |
write(byte[] buffer)
Write a byte array to the buffer.
|
void |
write(byte[] buffer,
int offset,
int length)
Write a part of a byte array to the buffer.
|
void |
write(int value)
Write an int value to the buffer.
|
public DataOutput()
public DataOutput(String encoding)
encoding
- the encoding to be used for writingpublic byte[] getBytes()
public void write(int value)
value
- the given valuepublic void write(byte[] buffer)
buffer
- the given byte arraypublic void write(byte[] buffer, int offset, int length)
buffer
- the given byte bufferoffset
- the offset where to startlength
- the amount of bytes to be written from the arraypublic void print(String string) throws IOException
string
- the given stringIOException
- If an error occurs during writing the data to the bufferpublic void println(String string) throws IOException
string
- the given stringIOException
- If an error occurs during writing the data to the bufferpublic void println()
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.