Example usage for java.io ObjectOutput writeChar

List of usage examples for java.io ObjectOutput writeChar

Introduction

In this page you can find the example usage for java.io ObjectOutput writeChar.

Prototype

void writeChar(int v) throws IOException;

Source Link

Document

Writes a char value, which is comprised of two bytes, to the output stream.

Usage

From source file:gnu.trove.map.custom_hash.TObjectCharCustomHashMap.java

public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION// www. j av a  2 s.  co  m
    out.writeByte(0);

    // SUPER
    super.writeExternal(out);

    // STRATEGY
    out.writeObject(strategy);

    // NO_ENTRY_VALUE
    out.writeChar(no_entry_value);

    // NUMBER OF ENTRIES
    out.writeInt(_size);

    // ENTRIES
    for (int i = _set.length; i-- > 0;) {
        if (_set[i] != REMOVED && _set[i] != FREE) {
            out.writeObject(_set[i]);
            out.writeChar(_values[i]);
        }
    }
}