Binary Octet Stream

Posted : admin On 5/3/2019
Binary Octet Stream Rating: 3,6/5 9971 reviews

Did your computer fail to open an OCTET-STREAM file? We explain what OCTET-STREAM files are and recommend software that we know can open or convert your OCTET-STREAM files.

What is an OCTET-STREAM file?

The OCTET-STREAM format is used for file attachments on the Web with an unknown file type. These .octet-stream files are arbitrary binary data files that may be in any multimedia format. The OCTET-STREAM format was developed for Web browsers to understand that the file attachment is in an unknown file type, which also allows the user to choose to download and save the attached file in any file format that the user wants.

In other instances, the OCTET-STREAM file format is used to inform the user that the attached file may be saved in a recommended file format. This also allows the Web browser to enable the user to know the recommended file format for the attached .octet-stream file.

These OCTET-STREAM files may be opened by renaming the extension of the attached file to a specific file extension, and then by using an application with support for opening such files. For example, an .octet-stream file may be renamed to a .txt file (if it is indeed a .txt file), and Notepad may then be used to open the file. This means the user needs to know the file type of the attached .octet-stream file before renaming the file in the correct file extension.

Software that will open, convert or fix OCTET-STREAM files

Unfortunately we have not received enough suggestions for software that can open OCTET-STREAM files yet.

Try a universal file viewer

I would suggest that you try a universal file viewer like Free File Viewer. It can open over 200 different types of files - and very likely yours too! Download Free File Viewer.

By Prof. Jones (The File Expert)

Chief Content Editor and File Expert

Suggestions for this page? Mail me.
-->

Definition

Reads bytes from the underlying stream and advances the current position of the stream.

Overloads

Read()Read()Read()Read()

Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.

Read(Span<Byte>)Read(Span<Byte>)Read(Span<Byte>)Read(Span<Byte>)
Read(Span<Char>)Read(Span<Char>)Read(Span<Char>)Read(Span<Char>)
Read(Byte[], Int32, Int32)Read(Byte[], Int32, Int32)Read(Byte[], Int32, Int32)Read(Byte[], Int32, Int32)

Reads the specified number of bytes from the stream, starting from a specified point in the byte array.

Read(Char[], Int32, Int32)Read(Char[], Int32, Int32)Read(Char[], Int32, Int32)Read(Char[], Int32, Int32)

Reads the specified number of characters from the stream, starting from a specified point in the character array.

Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.

Returns

The next character from the input stream, or -1 if no characters are currently available.

Exceptions

An I/O error occurs.

ObjectDisposedExceptionObjectDisposedExceptionObjectDisposedExceptionObjectDisposedException

The stream is closed.

Examples

The following example shows how to read and write data using memory as a backing store. This example displays a list of invalid file path characters to the console. Although the code tries to display a list of all invalid file path characters, not all of the characters are within the displayable set of characters. Because the list of invalid characters can vary based on the system, output for this code may also vary.

Remarks

BinaryReader does not restore the file position after an unsuccessful read.

For a list of common I/O tasks, see Common I/O Tasks.

See also

Read(Span<Byte>)Read(Span<Byte>)Read(Span<Byte>)Read(Span<Byte>)

Parameters

Returns

Read(Span<Char>)Read(Span<Char>)Read(Span<Char>)Read(Span<Char>)

Parameters

Returns

Read(Byte[], Int32, Int32)Read(Byte[], Int32, Int32)Read(Byte[], Int32, Int32)Read(Byte[], Int32, Int32)

Reads the specified number of bytes from the stream, starting from a specified point in the byte array.

Parameters

index
Int32Int32Int32Int32

The starting point in the buffer at which to begin reading into the buffer.

count
Int32Int32Int32Int32

The number of bytes to read.

Returns

The number of bytes read into buffer. This might be less than the number of bytes requested if that many bytes are not available, or it might be zero if the end of the stream is reached.

Exceptions

ArgumentExceptionArgumentExceptionArgumentExceptionArgumentException

The buffer length minus index is less than count.

-or-

The number of decoded characters to read is greater than count. This can happen if a Unicode decoder returns fallback characters or a surrogate pair.

ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionArgumentNullException

buffer is null.

ArgumentOutOfRangeExceptionArgumentOutOfRangeExceptionArgumentOutOfRangeExceptionArgumentOutOfRangeException

index or count is negative.

ObjectDisposedExceptionObjectDisposedExceptionObjectDisposedExceptionObjectDisposedException

The stream is closed.

An I/O error occurs.

Examples

The following example shows how to write binary data by using memory as a backing store. It displays a message to the console that indicates whether the data was written correctly.

This example reads the contents of a file and displays each byte's numeric value in 16-column format. The end of the file that is being read is detected when the Read method returns zero bytes.

Remarks

BinaryReader does not restore the file position after an unsuccessful read operation.

For a list of common I/O tasks, see Common I/O Tasks.

See also

Read(Char[], Int32, Int32)Read(Char[], Int32, Int32)Read(Char[], Int32, Int32)Read(Char[], Int32, Int32)

Reads the specified number of characters from the stream, starting from a specified point in the character array.

Parameters

index
Int32Int32Int32Int32

The starting point in the buffer at which to begin reading into the buffer.

count
Int32Int32Int32Int32

The number of characters to read.

Returns

The total number of characters read into the buffer. This might be less than the number of characters requested if that many characters are not currently available, or it might be zero if the end of the stream is reached.

Exceptions

ArgumentExceptionArgumentExceptionArgumentExceptionArgumentException

The buffer length minus index is less than count.

-or-

The number of decoded characters to read is greater than count. This can happen if a Unicode decoder returns fallback characters or a surrogate pair.

ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionArgumentNullException

buffer is null.

ArgumentOutOfRangeExceptionArgumentOutOfRangeExceptionArgumentOutOfRangeExceptionArgumentOutOfRangeException

index or count is negative.

ObjectDisposedExceptionObjectDisposedExceptionObjectDisposedExceptionObjectDisposedException

The stream is closed.

An I/O error occurs.

Examples

The following example shows how to read and write data using memory as a backing store. This example displays a list of invalid file path characters to the console. Although the code tries to display a list of all invalid file path characters, not all of the characters are within the displayable set of characters. Because the list of invalid characters can vary based on the system, output for this code may also vary.

Remarks

BinaryReader does not restore the file position after an unsuccessful read operation.

For a list of common I/O tasks, see Common I/O Tasks.

See also

Applies to