import PDFDict from 'src/core/objects/PDFDict' ; import CharCodes from 'src/core/syntax/CharCodes' ; class PDFTrailerDict { static of = ( dict ) => new PDFTrailerDict ( dict ) ; readonly dict : PDFDict ; private constructor ( dict ) { this . dict = dict ; } toString ( ) { return `trailer\n${ this . dict . toString ( ) }` ; } sizeInBytes ( ) { return 8 + this . dict . sizeInBytes ( ) ; } copyBytesInto ( buffer , offset ) { const initialOffset = offset ; buffer [ offset ++ ] = CharCodes . t ; buffer [ offset ++ ] = CharCodes . r ; buffer [ offset ++ ] = CharCodes . a ; buffer [ offset ++ ] = CharCodes . i ; buffer [ offset ++ ] = CharCodes . l ; buffer [ offset ++ ] = CharCodes . e ; buffer [ offset ++ ] = CharCodes . r ; buffer [ offset ++ ] = CharCodes . Newline ; offset += this . dict . copyBytesInto ( buffer , offset ) ; return offset - initialOffset ; } } export default PDFTrailerDict ;