如何将用户定义的对象转换为字节数组

时间:2018-06-06 15:32:50

标签: java arrays outputstream

我正在尝试将我定义的名为 lineId 的对象转换为字节数组,以便将其反馈给OutputStream.write

static void serialize(IACLineSegment objectToSerialze, OutputStream outputStream) {
    ConductingEquipmentSerializer.serialize(objectToSerialze, outputStream);
    byte[] bytes
    ID lineId = objectToSerialze.getLine().getId();
    if (lineId != null){
      outputStream.write(//lineId byte array);
      } 

0 个答案:

没有答案