Here you can find the source of writeHeader(DataOutput data, String header)
public static void writeHeader(DataOutput data, String header) throws IOException
//package com.java2s; /* Copyright (c) 2013 OpenPlans. All rights reserved. * This code is licensed under the BSD New License, available at the root * application directory.//w ww . ja v a 2 s . com */ import java.io.DataOutput; import java.io.IOException; import java.nio.charset.Charset; public class Main { public final static byte NUL = 0x00; public static void writeHeader(DataOutput data, String header) throws IOException { byte[] bytes = header.getBytes(Charset.forName("US-ASCII")); data.write(bytes); data.writeByte(NUL); } }