private static ByteBuffer view2Buffer(IMeasurementMNode<ICachedMNode> node) {
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    try {
      ViewExpression.serialize(
          ((LogicalViewSchema) node.getSchema()).getExpression(), byteArrayOutputStream);
    } catch (IOException e) {
      // ByteArrayOutputStream is a memory-based output stream that does not involve disk IO and
      // will not throw an IOException except for OOM.
      throw new RuntimeException(e);
    }
    byte[] expressionData = byteArrayOutputStream.toByteArray();

    int bufferLength = VIEW_BASIC_LENGTH + expressionData.length;

    ByteBuffer buffer = ByteBuffer.allocate(bufferLength);
    ReadWriteIOUtils.write(VIEW_TYPE, buffer);
    ReadWriteIOUtils.write((short) bufferLength, buffer);
    ReadWriteIOUtils.write(convertTags2Long(node), buffer);
    ReadWriteIOUtils.write(node.isPreDeleted(), buffer);
    buffer.put(expressionData);
    return buffer;
  }
LogicalView MNode Record Structure: <br>
(var length record, with length member)

<ul>
  <li>1 byte: nodeType, as above
  <li>1 short (2 bytes): recLength, length of whole record
  <li>1 long (8 bytes): tagIndex, value of the offset within a measurement
  <li>1 boolean (1 bytes): statusBytes, isPreDeleted
  <li>var length ViewExpression
</ul>
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/RecordUtils.java