Documentation ¶
Index ¶
- Constants
- Variables
- type Reader
- func (r *Reader) ByteOrder() binary.ByteOrder
- func (r *Reader) BytesLeftUntilLimit() int64
- func (r *Reader) IsImplicit() bool
- func (r *Reader) IsLimitExhausted() bool
- func (r *Reader) Peek(n int) ([]byte, error)
- func (r *Reader) PopLimit()
- func (r *Reader) PushLimit(n int64) error
- func (r *Reader) Read(p []byte) (int, error)
- func (r *Reader) ReadFloat32() (float32, error)
- func (r *Reader) ReadFloat64() (float64, error)
- func (r *Reader) ReadInt16() (int16, error)
- func (r *Reader) ReadInt32() (int32, error)
- func (r *Reader) ReadString(n uint32) (string, error)
- func (r *Reader) ReadUInt16() (uint16, error)
- func (r *Reader) ReadUInt32() (uint32, error)
- func (r *Reader) ReadUInt8() (uint8, error)
- func (r *Reader) SetCodingSystem(cs charset.CodingSystem)
- func (r *Reader) SetDeflate()
- func (r *Reader) SetTransferSyntax(bo binary.ByteOrder, implicit bool)
- func (r *Reader) Skip(n int64) error
- 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 ¶
const LimitReadUntilEOF = -9999
LimitReadUntilEOF is a special dicomio.Reader limit indicating that there is no hard limit and the Reader should read until EOF.
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 struct {
// contains filtered or unexported fields
}
func (*Reader) BytesLeftUntilLimit ¶
func (*Reader) IsImplicit ¶
IsImplicit returns if the currently set transfer syntax on this *Reader is implicit or not.
func (*Reader) IsLimitExhausted ¶
func (*Reader) Peek ¶
Peek reads and returns the next n bytes (if possible) without advancing the underlying reader.
func (*Reader) PopLimit ¶
func (r *Reader) PopLimit()
PopLimit removes the most recent limit set, and restores the limit before that one.
func (*Reader) ReadFloat32 ¶
ReadFloat32 reads a float32 from the underlying *Reader.
func (*Reader) ReadFloat64 ¶
ReadFloat64 reads a float64 from the underlying *Reader.
func (*Reader) ReadString ¶
ReadString reads a string from the underlying *Reader.
func (*Reader) ReadUInt16 ¶
ReadUInt16 reads an uint16 from the underlying *Reader.
func (*Reader) ReadUInt32 ¶
ReadUInt32 reads an uint32 from the underlying *Reader.
func (*Reader) SetCodingSystem ¶
func (r *Reader) SetCodingSystem(cs charset.CodingSystem)
SetCodingSystem sets the charset.CodingSystem to be used when ReadString is called.
func (*Reader) SetDeflate ¶ added in v1.0.11
func (r *Reader) SetDeflate()
SetDeflate applies deflate decompression to the underlying *Reader for all subsequent reads. This should be set when working with a deflated transfer syntax. Right now this is expected to be called once when parsing the top level dicom data, and there is no facility to swap between deflate and non-deflate reading. This also sets the current limit to LimitReadUntilEOF, since the original limits (if any) will be based on uncompressed bytes.
func (*Reader) SetTransferSyntax ¶
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.