Java DataOutputStream Write String writeString(final DataOutputStream out, final String value)

Here you can find the source of writeString(final DataOutputStream out, final String value)

Description

write String

License

Open Source License

Parameter

Parameter Description
out a parameter
value a parameter

Exception

Parameter Description
IOException an exception

Declaration

public static void writeString(final DataOutputStream out, final String value) throws IOException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * SaveableLib is Copyright 2012 by Pedro M.
 * //from w  ww  .  j a v a 2s  . com
 * This file is part of SaveableLib.
 *
 * SaveableLib is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 *
 * SaveableLib is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 * 
 * Commercial Distribution License
 * If you would like to distribute SaveableLib (or portions thereof) under a
 * license other than the "GNU Lesser General Public License, version 3", please
 * contact Pedro M (pedro.pub@free.fr).
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with SaveableLib. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/

import java.io.DataOutputStream;
import java.io.IOException;

public class Main {
    private static final String STRING_VALUE_NULL = "nuUull";

    /**
     * 
     * @param out
     * @param value
     * @throws IOException
     */
    public static void writeString(final DataOutputStream out, final String value) throws IOException {
        out.writeUTF(value == null ? STRING_VALUE_NULL : value);
    }
}

Related

  1. writeString(DataOutputStream out, String theString)
  2. writeString(DataOutputStream out, String val)
  3. writeString(DataOutputStream output, String s)
  4. writeString(DataOutputStream outputStream, String string)
  5. writeString(final DataOutputStream out, final String str)
  6. writeString(String arg, DataOutputStream data)
  7. writeString(String s, DataOutputStream out)
  8. writeString(String s, DataOutputStream out)
  9. writeString(String s, DataOutputStream writer)