Here you can find the source of writeBytes(DataOutputStream out, byte[] data)
Parameter | Description |
---|---|
data | the value |
public static void writeBytes(DataOutputStream out, byte[] data) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.DataOutputStream; import java.io.IOException; public class Main { /**/*from w ww . j a va 2 s .co m*/ * Write a byte array. * * @param data the value * @return itself */ public static void writeBytes(DataOutputStream out, byte[] data) throws IOException { if (data == null) { out.writeInt(-1); } else { out.writeInt(data.length); out.write(data); } } }