Table of Contents

Class ReadHelper

Namespace
UglyToad.PdfPig.Core
Assembly
UglyToad.PdfPig.Core.dll

Helper methods for reading from PDF files.

public static class ReadHelper
Inheritance
ReadHelper
Inherited Members

Fields

AsciiCarriageReturn

The carriage return '\r' character.

public const byte AsciiCarriageReturn = 13

Field Value

byte

AsciiLineFeed

The line-feed '\n' character.

public const byte AsciiLineFeed = 10

Field Value

byte

Methods

IsCarriageReturn(byte)

Whether the character is a carriage return '\r' character.

public static bool IsCarriageReturn(byte c)

Parameters

c byte

Returns

bool

IsDigit(int)

Whether the given value is a digit or not.

public static bool IsDigit(int c)

Parameters

c int

Returns

bool

IsEndOfLine(byte)

Whether the character is an end of line character.

public static bool IsEndOfLine(byte b)

Parameters

b byte

Returns

bool

IsEndOfLine(char)

Whether the character is an end of line character.

public static bool IsEndOfLine(char c)

Parameters

c char

Returns

bool

IsEndOfName(int)

Whether the given character value is the end of a PDF Name token.

public static bool IsEndOfName(int ch)

Parameters

ch int

Returns

bool

IsHex(byte)

Whether the given character value is a valid hex value.

public static bool IsHex(byte b)

Parameters

b byte

Returns

bool

IsHex(char)

Whether the given character value is a valid hex value.

public static bool IsHex(char ch)

Parameters

ch char

Returns

bool

IsLineFeed(byte?)

Whether the character is an line feed '\n' character.

public static bool IsLineFeed(byte? c)

Parameters

c byte?

Returns

bool

IsSpace(int)

Whether the given character is a space.

public static bool IsSpace(int c)

Parameters

c int

Returns

bool

IsString(IInputBytes, string)

Whether the given string is at this position in the input. Resets to the current offset once read.

public static bool IsString(IInputBytes bytes, string s)

Parameters

bytes IInputBytes
s string

Returns

bool

IsValidUtf8(byte[])

Whether the given input bytes are valid UTF8.

public static bool IsValidUtf8(byte[] input)

Parameters

input byte[]

Returns

bool

IsWhitespace(byte)

Determines if a character is whitespace or not, this includes newlines.

public static bool IsWhitespace(byte c)

Parameters

c byte

Returns

bool

Remarks

These values are specified in table 1 (page 12) of ISO 32000-1:2008.

ReadInt(IInputBytes)

Read an int from the input.

public static int ReadInt(IInputBytes bytes)

Parameters

bytes IInputBytes

Returns

int

ReadLine(IInputBytes)

Read a string from the input until a newline.

public static string ReadLine(IInputBytes bytes)

Parameters

bytes IInputBytes

Returns

string

ReadLong(IInputBytes)

Read a long from the input.

public static long ReadLong(IInputBytes bytes)

Parameters

bytes IInputBytes

Returns

long

SkipSpaces(IInputBytes)

Skip any whitespace characters.

public static void SkipSpaces(IInputBytes bytes)

Parameters

bytes IInputBytes