Class FitsDataBlockStream
- Namespace
- FitsModel.FitsStream
- Assembly
- FitsModel.dll
Reads FitsDataBlocks from a stream and forwards them to any registered DataBlockWriterBase instances.
public class FitsDataBlockStream : Stream, IDisposable, IAsyncDisposable
- Inheritance
-
FitsDataBlockStream
- Implements
- Inherited Members
Constructors
FitsDataBlockStream(DataBlockWriterBase)
Reads FitsDataBlocks from a stream and forwards them to any registered DataBlockWriterBase instances.
public FitsDataBlockStream(DataBlockWriterBase dataBlockWriter)
Parameters
dataBlockWriter
DataBlockWriterBaseData block writer that will receive data blocks as they are read from the stream.
Properties
CanRead
Not implemented.
public override bool CanRead { get; }
Property Value
CanSeek
Not implemented.
public override bool CanSeek { get; }
Property Value
CanWrite
This stream will continuously accept data and write them to FitsDataBlocks.
public override bool CanWrite { get; }
Property Value
CancelToken
Cancellation token that can be used to flag any streams writing to this stream to stop.
public CancellationToken CancelToken { get; }
Property Value
DataBlockWriter
Writer that will receive full FitsDataBlocks as they are formed.
public IFitsDataBlockWriter DataBlockWriter { get; }
Property Value
Length
Not implemented.
public override long Length { get; }
Property Value
Position
Not implemented.
public override long Position { get; set; }
Property Value
Methods
ChunkMemoryStream(MemoryStream, int)
Splits a MemoryStream into chunks of size n
.
public static List<byte[]> ChunkMemoryStream(MemoryStream stream, int n)
Parameters
stream
MemoryStreamn
int
Returns
Flush()
Not implemented.
public override void Flush()
Read(byte[], int, int)
Not implemented.
public override int Read(byte[] buffer, int offset, int count)
Parameters
Returns
ReadFromFile(FileInfo, bool)
Reads a full FitsFile from the specified fileInfo
.
public static Task<FitsFile> ReadFromFile(FileInfo fileInfo, bool readImageOnly)
Parameters
fileInfo
FileInfoFile name to read.
readImageOnly
boolIf true, only the primary HDU and the first image HDU will be read. All other HDUs will be ignored.
Returns
Exceptions
- FitsModelException
Thrown if no file was found.
Seek(long, SeekOrigin)
Not implemented.
public override long Seek(long offset, SeekOrigin origin)
Parameters
offset
longorigin
SeekOrigin
Returns
SetLength(long)
Not implemented.
public override void SetLength(long value)
Parameters
value
long
Write(byte[], int, int)
Writes data to this stream. Data is buffered and chunked into 2880-byte FitsDataBlocks. Once a complete block is formed, it is forwarded to all registered DataBlockWriterBase instances.
public override void Write(byte[] buffer, int offset, int count)