Java Utililty Methods DataOutput Write Byte Array

List of utility methods to do DataOutput Write Byte Array

Description

The list of methods to do DataOutput Write Byte Array are organized into topic(s).

Method

voidwriteBytes(byte[] data, DataOutput out)
write Bytes
out.write(data);
voidwriteBytes(DataOutput dataOutput, byte[] bytes)
Write the byte array to the data output to be read in by readBytes.
if (bytes == null) {
    dataOutput.writeInt(-1);
} else {
    dataOutput.writeInt(bytes.length);
    dataOutput.write(bytes);
voidwriteBytes(DataOutputStream out, byte[] data)
Write a byte array.
if (data == null) {
    out.writeInt(-1);
} else {
    out.writeInt(data.length);
    out.write(data);
voidwriteBytesToSocket(InputStream requestData, DataOutputStream writeClient)
write Bytes To Socket
System.out.println("writeBytesToSocket");
byte b;
while ((b = (byte) requestData.read()) != -1) {
    writeClient.write(b);
voidwriteBytesWithLength(DataOutput out, byte[] bytes)
write Bytes With Length
out.writeInt(bytes.length);
if (bytes.length > 0) {
    out.write(bytes);