Code example for DataOutputStream

Methods: flushwriteByte

0
    public DataOutputStream getUnderlayingStream(){
        return outputStream;
    } 
 
    public void writePacket(IPacket packet) throws IOException {
        this.outputStream.writeByte(packet.getPacketId());
        packet.writeExternal(outputStream);
        outputStream.flush();
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java