Home Index classes Index static functions Index enumerations Index structure types

{Memory_stream|_base_class}


CLASS {Memory_stream|_base_class} , BYTES, TESTED(76) :



Create an instanse of the class {Memory_stream} (directly using the constructor {Memory_stream}) to work with streams of bytes / strings in the memory. See also a description on an ancestor class {Stream}.


IMPORT : {System_functions} , {Stream} , {Long_int} , {File_stream} .


BASE CLASS {Stream} .


BYTE Memory|_bytes[]



---------------------------------------------------------- 'size, position'

      

OVERRIDE Size ==> {Long_int}.{long}



OVERRIDE Position ==> {long}



OVERRIDE Set_pos (
     
{long} New|_position ,
     
{Stream}.{disp} Disp|osition_from )



METHOD Capacity ==> INT



METHOD Set_capacity ( INT Value|_capacity )



METHOD Allocate|_size ( INT Value|_size )



----------------------------------------------------------------- 'closing'

   

OVERRIDE Close , REPLACE



METHOD Make_empty



OVERRIDE Closed ==> BOOL



-------------------------------------------------------- 'read/write bytes'

     

OVERRIDE Load_bytes (
     
BYTE Dest|ination [] ,
     
INT Count|_bytes_read ) ==> BOOL



OVERRIDE Read_bytes ( BYTE Dest|ination [*] ) ==> INT



OVERRIDE Read_byte ==> BYTE



OVERRIDE Save_bytes ( BYTE Source|_bytes [*] ) ==> INT



OVERRIDE Write_byte ( BYTE B|yte_single ) , REPLACE



------------------------------------------------------------- 'copy stream'

  

OVERRIDE Copy_part_of_stream (
     
{Stream} Source|_stream ,
     
{long} Len|gth_bytes ) , REPLACE



FUNCTION File_to_memory ( STR Path|_file ) ==> {Memory_stream} , NEW



----------------------------------------------------- 'faster read strings'

 

OVERRIDE Get_line ==> STR


END