Java Text File Write writeString(String string, ObjectOutput out)

Here you can find the source of writeString(String string, ObjectOutput out)

Description

write String

License

Open Source License

Declaration

public static void writeString(String string, ObjectOutput out) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.io.ObjectOutput;

public class Main {
    public static final int NULL = 0x00;
    public static final int NOTNULL = 0x01;

    public static void writeString(String string, ObjectOutput out) throws IOException {
        if (string == null) {
            out.writeByte(NULL);//from  w  w  w.j ava2s  .c o  m
        } else {
            out.writeByte(NOTNULL);
            out.writeUTF(string);
        }
    }

    public static void writeByte(Byte num, ObjectOutput out) throws IOException {
        if (num == null) {
            out.writeByte(NULL);
        } else {
            out.writeByte(NOTNULL);
            out.writeByte(num);
        }
    }
}

Related

  1. writeString(String par0)
  2. writeString(String path, String key, String value)
  3. writeString(String path, String str)
  4. writeString(String path, String str, boolean append)
  5. writeString(String s, File output, String encoding)
  6. writeString(String value)
  7. writeString(StringBuilder out, CharSequence value, boolean escapeXML)
  8. writeStringField(String name, String value, JsonGenerator jgen)
  9. writeStringFile(String FileName, String text)