diff --git a/Assets/Scripts/OCES/Haptic/Handwritten/HandwrittenDefinitions.cs b/Assets/Scripts/OCES/Haptic/Handwritten/HandwrittenDefinitions.cs index fa11f17..7b09ab3 100644 --- a/Assets/Scripts/OCES/Haptic/Handwritten/HandwrittenDefinitions.cs +++ b/Assets/Scripts/OCES/Haptic/Handwritten/HandwrittenDefinitions.cs @@ -31,15 +31,13 @@ namespace OCES.Haptic { if (bytes == null) return false; - using (MemoryStream memoryStream = new(bytes)) + using MemoryStream memoryStream = new(bytes); + using (BinaryReader br = new(memoryStream)) { - using (var br = new BinaryReader(memoryStream)) - { - data.DeSerialize(br); - br.Close(); - } - memoryStream.Close(); + data.DeSerialize(br); + br.Close(); } + memoryStream.Close(); return true; } }