private void writeTagPayload(Tag<?> tag) throws IOException {
        switch (tag.getType()) {
            case TAG_END:
                writeEndTagPayload((EndTag) tag);
                break;

            case TAG_BYTE:
                writeByteTagPayload((ByteTag) tag);
                break;

            case TAG_SHORT:
                writeShortTagPayload((ShortTag) tag);
                break;

            case TAG_INT:
                writeIntTagPayload((IntTag) tag);
                break;

            case TAG_LONG:
                writeLongTagPayload((LongTag) tag);
                break;

            case TAG_FLOAT:
                writeFloatTagPayload((FloatTag) tag);
                break;

            case TAG_DOUBLE:
                writeDoubleTagPayload((DoubleTag) tag);
                break;

            case TAG_BYTE_ARRAY:
                writeByteArrayTagPayload((ByteArrayTag) tag);
                break;

            case TAG_STRING:
                writeStringTagPayload((StringTag) tag);
                break;

            case TAG_LIST:
                writeListTagPayload((ListTag<?>) tag);
                break;

            case TAG_COMPOUND:
                writeCompoundTagPayload((CompoundTag) tag);
                break;

            case TAG_INT_ARRAY:
                writeIntArrayTagPayload((IntArrayTag) tag);
                break;

            case TAG_SHORT_ARRAY:
                writeShortArrayTagPayload((ShortArrayTag) tag);
                break;

            default:
                throw new IOException("Invalid tag type: " + tag.getType() + ".");
        }
    }
private void writeTagPayload ( Tag < ? > tag ) throws IOException { switch ( tag . getType ( ) ) { case TAG_END : writeEndTagPayload ( ( EndTag ) tag ) ; break ; case TAG_BYTE : writeByteTagPayload ( ( ByteTag ) tag ) ; break ; case TAG_SHORT : writeShortTagPayload ( ( ShortTag ) tag ) ; break ; case TAG_INT : writeIntTagPayload ( ( IntTag ) tag ) ; break ; case TAG_LONG : writeLongTagPayload ( ( LongTag ) tag ) ; break ; case TAG_FLOAT : writeFloatTagPayload ( ( FloatTag ) tag ) ; break ; case TAG_DOUBLE : writeDoubleTagPayload ( ( DoubleTag ) tag ) ; break ; case TAG_BYTE_ARRAY : writeByteArrayTagPayload ( ( ByteArrayTag ) tag ) ; break ; case TAG_STRING : writeStringTagPayload ( ( StringTag ) tag ) ; break ; case TAG_LIST : writeListTagPayload ( ( ListTag < ? > ) tag ) ; break ; case TAG_COMPOUND : writeCompoundTagPayload ( ( CompoundTag ) tag ) ; break ; case TAG_INT_ARRAY : writeIntArrayTagPayload ( ( IntArrayTag ) tag ) ; break ; case TAG_SHORT_ARRAY : writeShortArrayTagPayload ( ( ShortArrayTag ) tag ) ; break ; default : throw new IOException ( "Invalid tag type: " + tag . getType ( ) + "." ) ; } }
Writes tag payload.

@param tag The tag.
@throws java.io.IOException if an I/O error occurs.