Java Code Examples for cn.nukkit.nbt.stream.NBTOutputStream#writeInt()

The following examples show how to use cn.nukkit.nbt.stream.NBTOutputStream#writeInt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ByteArrayTag.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    if (data == null) {
        dos.writeInt(0);
        return;
    }
    dos.writeInt(data.length);
    dos.write(data);
}
 
Example 2
Source File: IntArrayTag.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    dos.writeInt(data.length);
    for (int aData : data) {
        dos.writeInt(aData);
    }
}
 
Example 3
Source File: ListTag.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    if (list.size() > 0) type = list.get(0).getId();
    else type = 1;

    dos.writeByte(type);
    dos.writeInt(list.size());
    for (T aList : list) aList.write(dos);
}
 
Example 4
Source File: ByteArrayTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    if (data == null) {
        dos.writeInt(0);
        return;
    }
    dos.writeInt(data.length);
    dos.write(data);
}
 
Example 5
Source File: IntArrayTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    dos.writeInt(data.length);
    for (int aData : data) {
        dos.writeInt(aData);
    }
}
 
Example 6
Source File: ListTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    if (list.size() > 0) type = list.get(0).getId();
    else type = 1;

    dos.writeByte(type);
    dos.writeInt(list.size());
    for (T aList : list) aList.write(dos);
}
 
Example 7
Source File: ByteArrayTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    if (data == null) {
        dos.writeInt(0);
        return;
    }
    dos.writeInt(data.length);
    dos.write(data);
}
 
Example 8
Source File: IntArrayTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    dos.writeInt(data.length);
    for (int aData : data) {
        dos.writeInt(aData);
    }
}
 
Example 9
Source File: ListTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    if (list.size() > 0) type = list.get(0).getId();
    else type = 1;

    dos.writeByte(type);
    dos.writeInt(list.size());
    for (T aList : list) aList.write(dos);
}
 
Example 10
Source File: IntTag.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    dos.writeInt(data);
}
 
Example 11
Source File: IntTag.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    dos.writeInt(data);
}
 
Example 12
Source File: IntTag.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
void write(NBTOutputStream dos) throws IOException {
    dos.writeInt(data);
}