Search in sources :

Example 6 with Message

use of me.perrycate.groupmeutils.data.Message in project groupme-utils by TheGuyWithTheFace.

the class MessageIterator method loadMessages.

// Pops the next set of messages out of storage. If no messages are
// avilable, returns an empty array.
private Message[] loadMessages() {
    if (storage.isEmpty()) {
        return new Message[0];
    }
    Object o = ByteConverter.bytesToObject(storage.removeFirst());
    GroupMessages gm = (GroupMessages) o;
    return gm.getMessages();
}
Also used : Message(me.perrycate.groupmeutils.data.Message) GroupMessages(me.perrycate.groupmeutils.data.GroupMessages)

Aggregations

Message (me.perrycate.groupmeutils.data.Message)6 GroupMessages (me.perrycate.groupmeutils.data.GroupMessages)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 IOException (java.io.IOException)2 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 BufferedOutputStream (java.io.BufferedOutputStream)1 BufferedReader (java.io.BufferedReader)1 FileNotFoundException (java.io.FileNotFoundException)1 FileReader (java.io.FileReader)1 OutputStream (java.io.OutputStream)1 LocalDate (java.time.LocalDate)1 HashMap (java.util.HashMap)1 MessageIterator (me.perrycate.groupmeutils.api.MessageIterator)1 Member (me.perrycate.groupmeutils.data.Member)1 ChunkStorage (me.perrycate.groupmeutils.util.ChunkStorage)1