Java DataOutput Write String writeString(String par0Str, DataOutput par1DataOutput)

Here you can find the source of writeString(String par0Str, DataOutput par1DataOutput)

Description

write String

License

Open Source License

Declaration

private static void writeString(String par0Str,
            DataOutput par1DataOutput) throws IOException 

Method Source Code

//package com.java2s;

import java.io.DataOutput;

import java.io.IOException;

public class Main {
    private static void writeString(String par0Str,
            DataOutput par1DataOutput) throws IOException {
        if (par0Str.length() > 32767) {
            throw new IOException("String too big");
        } else {/*  w  w  w. j av a 2s. c o  m*/
            par1DataOutput.writeShort(par0Str.length());
            par1DataOutput.writeChars(par0Str);
        }
    }
}

Related

  1. writeString(DataOutput out, String s)
  2. writeString(DataOutput out, String v)
  3. writeString(DataOutput output, String s)
  4. writeString(final String data, final DataOutput out, final int length)
  5. writeString(final String string, final DataOutput out)
  6. writeString(String s, DataOutput output)
  7. writeString(String s, DataOutput stream)
  8. writeString(String s, DataOutput stream)