readHeader :: Net.PalaceConnection -> Net.PalaceMessageConverters -> IO Inbound.Header
readHeader connection messageConverters =
  do
    let byteSource = Net.palaceByteSource connection
        intReader = Net.palaceIntReader messageConverters
        readNextInt = Receive.readIntFromNetwork intReader byteSource
    msgType <- PalaceMsgTypes.idToMessageType <$> readNextInt
    size <- readNextInt
    referenceNumber <- readNextInt
    return Inbound.PalaceHeader {
      Inbound.messageType = msgType,
      Inbound.messageSize = size,
      Inbound.messageRefNumber = referenceNumber
    }
readHeader :: Net.PalaceConnection -> Net.PalaceMessageConverters -> IO Inbound.Header
readHeader connection messageConverters =
  do
    let byteSource = Net.palaceByteSource connection
        intReader = Net.palaceIntReader messageConverters
        readNextInt = Receive.readIntFromNetwork intReader byteSource
    msgType <- PalaceMsgTypes.idToMessageType <$> readNextInt
    size <- readNextInt
    referenceNumber <- readNextInt
    return Inbound.PalaceHeader {
      Inbound.messageType = msgType,
      Inbound.messageSize = size,
      Inbound.messageRefNumber = referenceNumber
    }
readHeader connection messageConverters =
  do
    let byteSource = Net.palaceByteSource connection
        intReader = Net.palaceIntReader messageConverters
        readNextInt = Receive.readIntFromNetwork intReader byteSource
    msgType <- PalaceMsgTypes.idToMessageType <$> readNextInt
    size <- readNextInt
    referenceNumber <- readNextInt
    return Inbound.PalaceHeader {
      Inbound.messageType = msgType,
      Inbound.messageSize = size,
      Inbound.messageRefNumber = referenceNumber
    }