Code4bin Delphi Online

function TBinaryReaderHelper.ReadStringRaw(Length: Integer): string; var Bytes: TBytes; begin SetLength(Bytes, Length); Self.Read(Bytes[0], Length); Result := TEncoding.ASCII.GetString(Bytes); end;

end.

procedure TBinaryWriterHelper.WriteStringRaw(const Value: string); var Bytes: TBytes; begin Bytes := TEncoding.ASCII.GetBytes(Value); Self.Write(Bytes[0], Length(Bytes)); end; code4bin delphi

TBinaryWriterHelper = class helper for TStream public procedure WriteInt32(Value: Integer); procedure WriteStringRaw(const Value: string); end; function TBinaryReaderHelper