Here you can find the source of writeString(final DataOutputStream out, final String value)
Parameter | Description |
---|---|
out | a parameter |
value | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static void writeString(final DataOutputStream out, final String value) throws IOException
//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); } }