public override void Write(Stream stream, FrameContent content) { CodecState state = new CodecState(); CodecItem codecItem = CodecItemByFrameId(FrameId); codecItem.Write(state, stream, (content as FrameContentText).Text); }
public override void Read(Stream stream, int count, FrameContent content) { CodecState state = new CodecState(); CodecItem codecItem = CodecItemByFrameId(FrameId); (content as FrameContentText).Text = codecItem.Read(state, stream) as string; }
public void Write(CodecState state, Stream stream, object obj) { state.CurrentTextCodec.WriteString(stream, (string)obj); if (state.ItemIndex < state.ItemCount - 1) { state.CurrentTextCodec.WriteDelimiter(stream); } }
public void Write(CodecState state, Stream stream, object obj) { ID3.Codec.TextEncoderISO_8859_1.Instance.WriteString(stream, (string)obj); if (state.ItemIndex < state.ItemCount - 1) { ID3.Codec.TextEncoderISO_8859_1.Instance.WriteDelimiter(stream); } }
public object Read(CodecState state, Stream stream) { int length = (int)(stream.Length - stream.Position); byte[] data = new byte[length]; int bytesRead = stream.Read(data, 0, length); if (bytesRead < length) { byte[] copy = new byte[bytesRead]; Array.Copy(data, copy, bytesRead); return(copy); } else { return(data); } }
public void Write(CodecState state, Stream stream, object obj) { state.CurrentTextCodec.WriteStrings(stream, (List <string>)obj); }
public object Read(CodecState state, Stream stream) { return(state.CurrentTextCodec.ReadStrings(stream)); }
public object Read(CodecState state, Stream stream) { return(ID3.Codec.TextEncoderISO_8859_1.Instance.ReadString(stream, false)); }
public void Write(CodecState state, Stream stream, object obj) { ID3.Codec.TextEncoderISO_8859_1.Instance.WriteStringFixedLength( stream, (string)obj, Length); }
public object Read(CodecState state, Stream stream) { state.CheckEnoughDataForRead(stream, Length); return(ID3.Codec.TextEncoderISO_8859_1.Instance.ReadStringFixedLength(stream, Length)); }
public void Write(CodecState state, Stream stream, object obj) { byte[] data = obj as byte[]; stream.Write(data, 0, data.Length); }
public void Write(CodecState state, Stream stream, object obj) { stream.WriteByte((byte)(int)obj); }
public object Read(CodecState state, Stream stream) { state.CheckEnoughDataForRead(stream, 1); return((int)stream.ReadByte()); }
public void Write(CodecState state, Stream stream, object obj) { Serializer.Write(state, stream, Converter.ConvertBeforeWrite(obj)); }
public object Read(CodecState state, Stream stream) { return(Converter.ConvertAfterRead(Serializer.Read(state, stream))); }