Skip to content

Commit

Permalink
Fixed javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
fnetz committed Apr 14, 2017
1 parent f291bb6 commit e6ff15c
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions src/main/java/org/fnet/mcrconapi/packet/Packet.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,42 +56,6 @@ protected static ByteBuffer getByteBuffer(InputStream stream, int length) throws
return ByteBuffer.wrap(lengthBytes).order(ByteOrder.LITTLE_ENDIAN);
}

// /**
// * Reads a package data from an {@link InputStream}
// *
// * @param dataStream
// * the {@link InputStream} to read from
// * @param clientside
// * if the packet is a request
// * @return the resulting packet
// * @throws IOException
// * if an I/O error occurs
// */
// public static Packet readFrom(InputStream dataStream, boolean clientside)
// throws IOException {
// Packet packet = new Packet();
// packet.length = getByteBuffer(dataStream, 4).getInt();
// if (packet.length < 10)
// throw new MalformedPacketException("Packet length lower than ten (minimum
// package size)");
// packet.requestID = getByteBuffer(dataStream, 4).getInt();
// packet.type = PacketType.fromID(getByteBuffer(dataStream, 4).getInt(),
// clientside);
// if (packet.type == null)
// throw new MalformedPacketException("Packet type is none of known packet
// types");
// int payloadLength = packet.length - (Integer.BYTES * 2 + Byte.BYTES * 2);
// packet.payload = new byte[payloadLength];
// for (int i = 0; i < payloadLength; i++) {
// packet.payload[i] = (byte) dataStream.read();
// }
// if (dataStream.read() != 0)
// throw new MalformedPacketException("Payload terminator byte not zero");
// if (dataStream.read() != 0)
// throw new MalformedPacketException("Packet terminator byte not zero");
// return packet;
// }

/**
* Generates a new packet with a type and a payload given. The length and
* requestID are automatically generated where the requestID is a value that
Expand All @@ -114,11 +78,8 @@ public Packet(PacketType type, String payload) {
/**
* Reads a package from an {@link InputStream}
*
* @param dataStream
* @param stream
* the {@link InputStream} to read from
* @param clientside
* if the packet is a request
* @return the resulting packet
* @throws IOException
* if an I/O error occurs
*/
Expand Down

0 comments on commit e6ff15c

Please sign in to comment.