Documentation
¶
Index ¶
- Variables
- type Reader
- type Writer
- func (w *Writer) GetTransferSyntax() (binary.ByteOrder, bool)
- func (w *Writer) SetTransferSyntax(bo binary.ByteOrder, implicit bool)
- func (w *Writer) WriteByte(v byte) error
- func (w *Writer) WriteBytes(v []byte) error
- func (w *Writer) WriteFloat32(v float32) error
- func (w *Writer) WriteFloat64(v float64) error
- func (w *Writer) WriteString(v string) error
- func (w *Writer) WriteUInt16(v uint16) error
- func (w *Writer) WriteUInt32(v uint32) error
- func (w *Writer) WriteZeros(len int) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrorInsufficientBytesLeft indicates there are not enough bytes left in // the current buffer (or enough bytes left until the currently set limit) // to complete the operation. ErrorInsufficientBytesLeft = errors.New("not enough bytes left until buffer limit to complete this operation") )
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader interface {
io.Reader
// ReadUInt8 reads a uint16 from the underlying reader.
ReadUInt8() (uint8, error)
// ReadUInt16 reads a uint16 from the underlying reader.
ReadUInt16() (uint16, error)
// ReadUInt32 reads a uint32 from the underlying reader.
ReadUInt32() (uint32, error)
// ReadInt16 reads a int16 from the underlying reader.
ReadInt16() (int16, error)
// ReadInt32 reads a int32 from the underlying reader.
ReadInt32() (int32, error)
// ReadFloat32 reads a float32 from the underlying reader.
ReadFloat32() (float32, error)
// ReadFloat64 reads a float32 from the underlying reader.
ReadFloat64() (float64, error)
// ReadString reads an n byte string from the underlying reader.
// Uses the charset.CodingSystem encoding decoders to read the string, if
// set.
ReadString(n uint32) (string, error)
// Skip skips the reader ahead by n bytes.
Skip(n int64) error
// Peek returns the next n bytes without advancing the reader. This will
// return bufio.ErrBufferFull if the buffer is full.
Peek(n int) ([]byte, error)
// PushLimit sets a read limit of n bytes from the current position of the
// reader. Once the limit is reached, IsLimitExhausted will return true, and
// other attempts to read data from dicomio.Reader will return io.EOF.
PushLimit(n int64) error
// PopLimit removes the most recent limit set, and restores the limit before
// that one.
PopLimit()
// IsLimitExhausted indicates whether or not we have read up to the
// currently set limit position.
IsLimitExhausted() bool
// BytesLeftUntilLimit returns the number of bytes remaining until we reach
// the currently set limit position.
BytesLeftUntilLimit() int64
// SetTransferSyntax sets the byte order and whether the current transfer
// syntax is implicit or not.
SetTransferSyntax(bo binary.ByteOrder, implicit bool)
// IsImplicit returns if the currently set transfer syntax on this Reader is
// implicit or not.
IsImplicit() bool
// SetCodingSystem sets the charset.CodingSystem to be used when ReadString
// is called.
SetCodingSystem(cs charset.CodingSystem)
ByteOrder() binary.ByteOrder
}
Reader provides common functionality for reading underlying DICOM data.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a lower level encoder that manages writing out entities to an io.Reader.
func (*Writer) GetTransferSyntax ¶
GetTransferSyntax gets the current transfer syntax of this Writer.
func (*Writer) SetTransferSyntax ¶
SetTransferSyntax sets the current transfer syntax of this Writer.
func (*Writer) WriteBytes ¶
WriteBytes writes the provided byte slice to the Writer.
func (*Writer) WriteFloat32 ¶
WriteFloat32 writes the provided float32 to the Writer.
func (*Writer) WriteFloat64 ¶
WriteFloat64 writes the provided float64 to the Writer.
func (*Writer) WriteString ¶
WriteString writes the provided string to the Writer.
func (*Writer) WriteUInt16 ¶
WriteUInt16 writes the provided uint16 to the Writer.
func (*Writer) WriteUInt32 ¶
WriteUInt32 writes the provided uint32 to the Writer.
func (*Writer) WriteZeros ¶
WriteZeros writes len bytes of zeros at the current position of the Writer.