Java命名-字节缓冲区读取器/写入器或输入/输出流?

时间:2018-09-13 13:09:06

标签: java oop naming-conventions readability

通过几个不同的项目,我可以看到相同项目的两种不同命名。

哪个是正确/错误的,还是相对于另一个更普遍理解的?

项目1:

//reading
byte[] data;
InputStream is = new InputStream(data);
int value = is.getUnsignedByte();

//writing
OutputStream os = new OutputStream(16); //arg0 = capacity (not revelant here)
os.writeByte(value);

项目2:

//reading
byte[] data;
ByteBufReader reader = new ByteBufReader(data);
int value = reader.getUnsigned(DataType.BYTE, DataOrder.REGULAR);

//writing
ByteBufBuilder builder = new ByteBufBuilder(16); //arg0 = capacity (not revelant here)
builder.put(DataType.BYTE, DataOrder.REGULAR, value);

0 个答案:

没有答案