Documentation ¶
Index ¶
- type BinaryWriter
- func (w *BinaryWriter) WriteBoolean(off int64, value bool)
- func (w *BinaryWriter) WriteByte(off int64, value byte)
- func (w *BinaryWriter) WriteBytes(off int64, value []byte)
- func (w *BinaryWriter) WriteInt16(off int64, value int16)
- func (w *BinaryWriter) WriteInt32(off int64, value int32)
- func (w *BinaryWriter) WriteInt64(off int64, value int64)
- func (w *BinaryWriter) WriteString(off int64, value string)
- func (w *BinaryWriter) WriteUInt16(off int64, value uint16)
- func (w *BinaryWriter) WriteUInt32(off int64, value uint32)
- func (w *BinaryWriter) WriteUInt64(off int64, value uint64)
- type ByteSliceWriteAt
- type VhdWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryWriter ¶
type BinaryWriter struct { Size int64 // contains filtered or unexported fields }
BinaryWriter is the writer which can be used to write values of primitive types to a writer The writer supports writing data both in little-endian or big-endian format.
func NewBinaryWriter ¶
NewBinaryWriter creates a new instance of BinaryWriter, to is the underlying data source to write to, order is the byte order used to encode the data in the source, size is the length of the data source in bytes.
func (*BinaryWriter) WriteBoolean ¶
func (w *BinaryWriter) WriteBoolean(off int64, value bool)
WriteBoolean write a boolean value to the underlying writer at offset off.
func (*BinaryWriter) WriteByte ¶
func (w *BinaryWriter) WriteByte(off int64, value byte)
WriteByte write a byte value to the underlying writer at offset off.
func (*BinaryWriter) WriteBytes ¶
func (w *BinaryWriter) WriteBytes(off int64, value []byte)
WriteBytes writes a byte slice to the underlying writer at offset off.
func (*BinaryWriter) WriteInt16 ¶
func (w *BinaryWriter) WriteInt16(off int64, value int16)
WriteInt16 encodes an int16 and write it in the underlying writer at offset off.
func (*BinaryWriter) WriteInt32 ¶
func (w *BinaryWriter) WriteInt32(off int64, value int32)
WriteInt32 encodes an int32 and write it in the underlying writer at offset off.
func (*BinaryWriter) WriteInt64 ¶
func (w *BinaryWriter) WriteInt64(off int64, value int64)
WriteInt64 encodes an int64 and write it in the underlying writer at offset off.
func (*BinaryWriter) WriteString ¶
func (w *BinaryWriter) WriteString(off int64, value string)
WriteString writes a string to the underlying writer at offset off.
func (*BinaryWriter) WriteUInt16 ¶
func (w *BinaryWriter) WriteUInt16(off int64, value uint16)
WriteUInt16 encodes an uint16 and write it in the underlying writer at offset off.
func (*BinaryWriter) WriteUInt32 ¶
func (w *BinaryWriter) WriteUInt32(off int64, value uint32)
WriteUInt32 encodes an uint32 and write it in the underlying writer at offset off.
func (*BinaryWriter) WriteUInt64 ¶
func (w *BinaryWriter) WriteUInt64(off int64, value uint64)
WriteUInt64 encodes an uint64 and write it in the underlying writer at offset off.
type ByteSliceWriteAt ¶
type ByteSliceWriteAt []byte
ByteSliceWriteAt is a type that satisfies io.WriteAt interface for byte slice.
type VhdWriter ¶
type VhdWriter struct {
*BinaryWriter
}
VhdWriter is the writer used by various components responsible for writing header and footer of the VHD.
func NewVhdWriter ¶
NewVhdWriter creates new instance of the VhdWriter, that writes to the underlying target, size is the size of the target in bytes.
func NewVhdWriterFromByteSlice ¶
NewVhdWriterFromByteSlice creates a new instance of VhdWriter, that uses the given byte slice as the underlying target to write to.