Java Text File Write nio writeHeader(DataOutput data, String header)

Here you can find the source of writeHeader(DataOutput data, String header)

Description

write Header

License

Open Source License

Declaration

public static void writeHeader(DataOutput data, String header) throws IOException 

Method Source Code

//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);
    }
}

Related

  1. writeData(String address, BigInteger toWrite)
  2. writeDataFromList(String address, ArrayList toWrite)
  3. writeFileContent(File file, String content)
  4. writeFileContents(File file, String content)
  5. writeFileTxt(String fileName, String[] totalFile)
  6. writeIfSet(final OutputStream outputStream, final String field, final String value)
  7. writeLine(final CharBuffer line, final CharBuffer output)
  8. writeLines(Collection lines, File file)
  9. writeLines(File file, Iterable lines)